diff options
author | Makoto Onuki <omakoto@google.com> | 2012-04-10 13:45:18 -0700 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2012-04-11 10:23:05 -0700 |
commit | b7e305c1ad38f1e2058453f7412e51477adf8a24 (patch) | |
tree | 58847d211126ab92a704d46c018d1e7c47b06f14 /src | |
parent | 18cb61aa592aa2c02c7f583f608ad0f8832f5742 (diff) | |
download | packages_providers_ContactsProvider-b7e305c1ad38f1e2058453f7412e51477adf8a24.zip packages_providers_ContactsProvider-b7e305c1ad38f1e2058453f7412e51477adf8a24.tar.gz packages_providers_ContactsProvider-b7e305c1ad38f1e2058453f7412e51477adf8a24.tar.bz2 |
System prop to keep stale account data
If set to 1 (adb shell setprop debug.contacts.ksad 1) the provider
won't remvoe any data when accounts are removed.
This should be used sparingly; even though there are data still available,
the UI don't know anything about them, so they won't show up in the contact
filter screen, and the contact card/editor may get confused to see unknown
custom mimetypes.
Change-Id: Id036d7e0dd68b84bba953690a74648b25cf090b8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/providers/contacts/ContactsProvider2.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java index 1cba421..4650903 100644 --- a/src/com/android/providers/contacts/ContactsProvider2.java +++ b/src/com/android/providers/contacts/ContactsProvider2.java @@ -217,6 +217,18 @@ public class ContactsProvider2 extends AbstractContactsProvider private static final String AGGREGATE_CONTACTS = "sync.contacts.aggregate"; + /** + * If set to "1", we don't remove account data when accounts have been removed. + * + * This should be used sparingly; even though there are data still available, the UI + * don't know anything about them, so they won't show up in the contact filter screen, and + * the contact card/editor may get confused to see unknown custom mimetypes. + * + * We can't spell it out because a property name must be less than 32 chars. + */ + private static final String DEBUG_PROPERTY_KEEP_STALE_ACCOUNT_DATA = + "debug.contacts.ksad"; + private static final ProfileAwareUriMatcher sUriMatcher = new ProfileAwareUriMatcher(UriMatcher.NO_MATCH); @@ -4470,6 +4482,11 @@ public class ContactsProvider2 extends AbstractContactsProvider if (!haveAccountsChanged(systemAccounts)) { return false; } + if ("1".equals(SystemProperties.get(DEBUG_PROPERTY_KEEP_STALE_ACCOUNT_DATA))) { + Log.w(TAG, "Accounts changed, but not removing stale data for " + + DEBUG_PROPERTY_KEEP_STALE_ACCOUNT_DATA); + return true; + } Log.i(TAG, "Accounts changed"); invalidateFastScrollingIndexCache(); |