summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/accounts
diff options
context:
space:
mode:
authorZhenguo Fu <zhenguo.fu@sonyericsson.com>2011-04-15 11:24:31 +0800
committerJohan Redestig <johan.redestig@sonymobile.com>2012-06-07 14:42:28 +0200
commit193821e6e850d1fb76d01e369856a35d00fc9bed (patch)
treebb166380b5de06826277f6a01b8e6af232ef8675 /src/com/android/settings/accounts
parent8ad7abbcf64076b4df8ff3e724815c2e7940be8e (diff)
downloadpackages_apps_Settings-193821e6e850d1fb76d01e369856a35d00fc9bed.zip
packages_apps_Settings-193821e6e850d1fb76d01e369856a35d00fc9bed.tar.gz
packages_apps_Settings-193821e6e850d1fb76d01e369856a35d00fc9bed.tar.bz2
Add account type check for invisible sync adapters.
The invisible sync adapters array is modified to store the sync adapters instead of their authorities, so that "Sync now" function will only synchronize those with the same account type as the current account. Change-Id: If9b0b32db9828d8671f57a0d7a2f64712a7ebabf
Diffstat (limited to 'src/com/android/settings/accounts')
-rw-r--r--src/com/android/settings/accounts/AccountSyncSettings.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 82f9844..6847607 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -81,7 +81,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
private Account[] mAccounts;
private ArrayList<SyncStateCheckBoxPreference> mCheckBoxes =
new ArrayList<SyncStateCheckBoxPreference>();
- private ArrayList<String> mInvisibleAdapters = Lists.newArrayList();
+ private ArrayList<SyncAdapterType> mInvisibleAdapters = Lists.newArrayList();
@Override
public Dialog onCreateDialog(final int id) {
@@ -321,8 +321,11 @@ public class AccountSyncSettings extends AccountPreferenceBase {
}
// plus whatever the system needs to sync, e.g., invisible sync adapters
if (mAccount != null) {
- for (String authority : mInvisibleAdapters) {
- requestOrCancelSync(mAccount, authority, startSync);
+ for (SyncAdapterType syncAdapter : mInvisibleAdapters) {
+ // invisible sync adapters' account type should be same as current account type
+ if (syncAdapter.accountType.equals(mAccount.type)) {
+ requestOrCancelSync(mAccount, syncAdapter.authority, startSync);
+ }
}
}
}
@@ -449,7 +452,7 @@ public class AccountSyncSettings extends AccountPreferenceBase {
} else {
// keep track of invisible sync adapters, so sync now forces
// them to sync as well.
- mInvisibleAdapters.add(sa.authority);
+ mInvisibleAdapters.add(sa);
}
}