List of usage examples for android.content ContentResolver SYNC_EXTRAS_IGNORE_BACKOFF
String SYNC_EXTRAS_IGNORE_BACKOFF
To view the source code for android.content ContentResolver SYNC_EXTRAS_IGNORE_BACKOFF.
Click Source Link
From source file:com.pindroid.syncadapter.BookmarkSyncAdapter.java
@Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) {//from w w w. ja v a 2 s . c om boolean upload = extras.containsKey(ContentResolver.SYNC_EXTRAS_UPLOAD); boolean manual = extras.containsKey(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF) && extras.containsKey(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS); try { if (upload) { Log.d(TAG, "Beginning Upload Sync"); DeleteBookmarks(account, syncResult); UploadBookmarks(account, syncResult); } else { if (manual) Log.d(TAG, "Beginning Manual Download Sync"); else Log.d(TAG, "Beginning Download Sync"); DeleteBookmarks(account, syncResult); UploadBookmarks(account, syncResult); InsertBookmarks(account, syncResult); } checkSecretToken(account); } catch (final ParseException e) { syncResult.stats.numParseExceptions++; Log.e(TAG, "ParseException", e); } catch (final AuthenticationException e) { syncResult.stats.numAuthExceptions++; Log.e(TAG, "AuthException", e); } catch (final IOException e) { syncResult.stats.numIoExceptions++; Log.e(TAG, "IOException", e); } catch (final TooManyRequestsException e) { syncResult.delayUntil = e.getBackoff(); Log.d(TAG, "Too Many Requests. Backing off for " + e.getBackoff() + " seconds."); } catch (PinboardException e) { syncResult.stats.numSkippedEntries++; Log.e(TAG, "PinboardException", e); } finally { Log.d(TAG, "Finished Sync"); LocalBroadcastManager.getInstance(getContext()).sendBroadcast(new Intent(SYNC_FINISHED_ACTION)); } }