Skip to content

Commit

Permalink
- fx a bug where an account was marked as syncable if
Browse files Browse the repository at this point in the history
  the only enabled sync adapter was marked as not syncable
  http://b/2441374

- allow one shot syncing even if the specific sync adapter
  doesn't have sync enabled. http://b/2403633
  • Loading branch information
fredquintana committed Feb 17, 2010
1 parent 6a10580 commit 5ae2380
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions src/com/android/settings/AccountSyncSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void onCreate(Bundle icicle) {
updateAuthDescriptions();
onAccountsUpdated(AccountManager.get(this).getAccounts());
}

@Override
protected void onDestroy() {
super.onDestroy();
Expand Down Expand Up @@ -239,11 +239,7 @@ public boolean onPreferenceTreeClick(PreferenceScreen preferences, Preference pr
Account account = syncPref.getAccount();
boolean syncAutomatically = ContentResolver.getSyncAutomatically(account, authority);
if (syncPref.isOneTimeSyncMode()) {
if (syncAutomatically) {
requestOrCancelSync(account, authority, true);
} else {
showDialog(CANT_DO_ONETIME_SYNC_DIALOG);
}
requestOrCancelSync(account, authority, true);
} else {
boolean syncOn = syncPref.isChecked();
boolean oldSyncState = syncAutomatically;
Expand Down Expand Up @@ -366,8 +362,9 @@ protected void onSyncStateUpdated() {
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
final boolean masterSyncAutomatically = ContentResolver.getMasterSyncAutomatically();
final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
syncPref.setOneTimeSyncMode(!masterSyncAutomatically || !backgroundDataEnabled);
syncPref.setChecked(syncEnabled);
final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
syncPref.setOneTimeSyncMode(oneTimeSyncMode);
syncPref.setChecked(oneTimeSyncMode || syncEnabled);
}
mErrorInfoView.setVisibility(syncIsFailing ? View.VISIBLE : View.GONE);
}
Expand Down
3 changes: 2 additions & 1 deletion src/com/android/settings/ManageAccountsSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ protected void onSyncStateUpdated() {
SyncStatusInfo status = ContentResolver.getSyncStatus(account, authority);
boolean syncEnabled = ContentResolver.getSyncAutomatically(account, authority)
&& masterSyncAutomatically
&& backgroundDataSetting;
&& backgroundDataSetting
&& (ContentResolver.getIsSyncable(account, authority) > 0);
boolean authorityIsPending = ContentResolver.isSyncPending(account, authority);
boolean activelySyncing = activeSyncValues != null
&& activeSyncValues.authority.equals(authority)
Expand Down

0 comments on commit 5ae2380

Please sign in to comment.