List of usage examples for android.content ContentResolver SYNC_EXTRAS_IGNORE_SETTINGS
String SYNC_EXTRAS_IGNORE_SETTINGS
To view the source code for android.content ContentResolver SYNC_EXTRAS_IGNORE_SETTINGS.
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) {/* ww w.j a va 2s. c o m*/ 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)); } }
From source file:de.spiritcroc.syncsettings.Util.java
public static void forceSyncNow(Account account, String authority) { Bundle extras = new Bundle(); extras.putBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_SETTINGS, true); ContentResolver.requestSync(account, authority, extras); }