diff options
author | Fred Quintana <fredq@google.com> | 2010-03-16 15:58:44 -0700 |
---|---|---|
committer | Fred Quintana <fredq@google.com> | 2010-03-16 15:58:44 -0700 |
commit | 7620f1ae498e01bf2df58eaa1b9b20ef1eb47fa1 (patch) | |
tree | fc094937e0b261541193dded15c9a85d9a6de49b /core/java/android/content/SyncStorageEngine.java | |
parent | ea579c7d73f4360fcffc0b260a0da1f149857395 (diff) | |
download | frameworks_base-7620f1ae498e01bf2df58eaa1b9b20ef1eb47fa1.zip frameworks_base-7620f1ae498e01bf2df58eaa1b9b20ef1eb47fa1.tar.gz frameworks_base-7620f1ae498e01bf2df58eaa1b9b20ef1eb47fa1.tar.bz2 |
Clean the settings for the account/authority when trying to sync an
adapter that is not installed.
Change-Id: Id4a804615b9546155948797f9dd9a0f03fbe4b2f
http://b/issue?id=2520175
Diffstat (limited to 'core/java/android/content/SyncStorageEngine.java')
-rw-r--r-- | core/java/android/content/SyncStorageEngine.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java index 0ec2453..03e606f 100644 --- a/core/java/android/content/SyncStorageEngine.java +++ b/core/java/android/content/SyncStorageEngine.java @@ -643,6 +643,12 @@ public class SyncStorageEngine extends Handler { } } + public void removeAuthority(Account account, String authority) { + synchronized (mAuthorities) { + removeAuthorityLocked(account, authority); + } + } + public AuthorityInfo getAuthority(int authorityId) { synchronized (mAuthorities) { return mAuthorities.get(authorityId); @@ -1272,6 +1278,15 @@ public class SyncStorageEngine extends Handler { return authority; } + private void removeAuthorityLocked(Account account, String authorityName) { + AccountInfo accountInfo = mAccounts.get(account); + if (accountInfo != null) { + if (accountInfo.authorities.remove(authorityName) != null) { + writeAccountInfoLocked(); + } + } + } + public SyncStatusInfo getOrCreateSyncStatus(AuthorityInfo authority) { synchronized (mAuthorities) { return getOrCreateSyncStatusLocked(authority.ident); @@ -1533,7 +1548,7 @@ public class SyncStorageEngine extends Handler { out.attribute(null, "authority", authority.authority); if (!authority.enabled) { out.attribute(null, "enabled", "false"); - } + } if (authority.syncable < 0) { out.attribute(null, "syncable", "unknown"); } else if (authority.syncable == 0) { |