summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-07-13 16:35:58 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-07-13 16:35:58 -0700
commite375fc5cacc187d1ee217a72e31f59a20e129c62 (patch)
tree67a037be5164fd646ef2b07d5499d048b1186dae /core/java
parent1dcdce6db705a882c6e752d00f8b89805e9968b8 (diff)
parent45107e0c328dc689effc62b7a5a5afc6f18c94ac (diff)
downloadframeworks_base-e375fc5cacc187d1ee217a72e31f59a20e129c62.zip
frameworks_base-e375fc5cacc187d1ee217a72e31f59a20e129c62.tar.gz
frameworks_base-e375fc5cacc187d1ee217a72e31f59a20e129c62.tar.bz2
Merge change 6787
* changes: AbstractSyncableContentProvider must only call onAccountsChanged with GAIA accounts
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/content/AbstractSyncableContentProvider.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/java/android/content/AbstractSyncableContentProvider.java b/core/java/android/content/AbstractSyncableContentProvider.java
index db73dd5..218f501 100644
--- a/core/java/android/content/AbstractSyncableContentProvider.java
+++ b/core/java/android/content/AbstractSyncableContentProvider.java
@@ -165,6 +165,20 @@ public abstract class AbstractSyncableContentProvider extends SyncableContentPro
// Some providers override onAccountsChanged(); give them a database to
// work with.
mDb = mOpenHelper.getWritableDatabase();
+ // Only call onAccountsChanged on GAIA accounts; otherwise, the contacts and
+ // calendar providers will choke as they try to sync unknown accounts with
+ // AbstractGDataSyncAdapter, which will put acore into a crash loop
+ ArrayList<Account> gaiaAccounts = new ArrayList<Account>();
+ for (Account acct: accounts) {
+ if (acct.mType.equals("com.google.GAIA")) {
+ gaiaAccounts.add(acct);
+ }
+ }
+ accounts = new Account[gaiaAccounts.size()];
+ int i = 0;
+ for (Account acct: gaiaAccounts) {
+ accounts[i++] = acct;
+ }
onAccountsChanged(accounts);
TempProviderSyncAdapter syncAdapter = getTempProviderSyncAdapter();
if (syncAdapter != null) {
@@ -175,7 +189,6 @@ public abstract class AbstractSyncableContentProvider extends SyncableContentPro
return true;
}
-
/**
* Get a non-persistent instance of this content provider.
* You must call {@link #close} on the returned