[android-developers] Android Syncadapter onPerformSync fails after cancel of previous sync
I am using the syncadapter to sync my applications data with my server. There are two ways in which I use the syncadapter - one is for continuos periodic background refresh and second for GETing or POSTing data every now and then upon user action. I use the following options for the one-time sync operation done upon user action -
Bundle extras = new Bundle();
extras.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
extras.putBoolean(ContentResolver.SYNC_EXTRAS_FORCE, true);
extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
extras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF, true);
extras.putBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY , true);
This I believe interrupts the current background sync and I get the following message,
07-10 23:51:43.152: DEBUG/SyncManager(59): handleSyncHandlerMessage: sync context doesn't match, dropping: mActiveSyncContext startTime 750699, mTimeoutStartTime 750699, mHistoryRowId 28, syncOperation authority: com.mewannaplay.providers.TennisCourtProvider account: Account {name=amit, type=com.mewannaplay} extras: [operation=8 ignore_settings=true ignore_backoff=true do_not_retry=true force=true expedited=true court_id=108 ] syncSource: 3 when: 750587 expedited: true != startTime 747204, mTimeoutStartTime 747204, mHistoryRowId 27, syncOperation authority: com.mewannaplay.providers.TennisCourtProvider account: Account {name=amit, type=com.mewannaplay} extras: [ACK_NEEDED=false operation=7 ] syncSource: 4 when: 746093 expedited: false
07-10 23:51:43.202: DEBUG/SyncManager(59): not retrying sync operation because SYNC_EXTRAS_DO_NOT_RETRY was specified authority: com.mewannaplay.providers.TennisCourtProvider account: Account {name=amit, type=com.mewannaplay} extras: [operation=8 ignore_settings=true do_not_retry=true expedited=true force=true court_id=108 ] syncSource: 3 when: 751449 expedited: true
And then the current sync operation never finishes. I am not sure how to handle the onCancelSync() in the syncadapter. What am I suppose to do there? This on android:minSdkVersion="8" to there is no onSyncCanceled(Thread t) but just the no-arg method. I also tried using false for the ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY still same issue.
Thanks in advance for your help.
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home