diff options
| author | John Reck <jreck@google.com> | 2011-01-19 10:15:47 -0800 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2011-01-19 16:50:40 -0800 |
| commit | 267b6af7ee9f731f0da6ae0b27f015308671b835 (patch) | |
| tree | 435dc754372118da4afc2d65cdd13e6c47c41c50 /src/com/android/browser/preferences | |
| parent | 04e1078455bec4643587c1e8c0750d44c33b74ae (diff) | |
| download | packages_apps_Browser-267b6af7ee9f731f0da6ae0b27f015308671b835.tar.gz packages_apps_Browser-267b6af7ee9f731f0da6ae0b27f015308671b835.tar.bz2 packages_apps_Browser-267b6af7ee9f731f0da6ae0b27f015308671b835.zip | |
Handle chrome sync account deleted case
Bug: 3337527, 3353260
Listens for changes to the system accounts and handles the case
of the chrome sync account being deleted. Also, enabling chrome sync
in the browser will now enable the browser sync in settings.
Change-Id: Iab2ed839fc5fc356a7a4d865965bfafcb39b4ee7
Diffstat (limited to 'src/com/android/browser/preferences')
| -rw-r--r-- | src/com/android/browser/preferences/GeneralPreferencesFragment.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/browser/preferences/GeneralPreferencesFragment.java b/src/com/android/browser/preferences/GeneralPreferencesFragment.java index 99a4ec9bf..273516616 100644 --- a/src/com/android/browser/preferences/GeneralPreferencesFragment.java +++ b/src/com/android/browser/preferences/GeneralPreferencesFragment.java @@ -304,7 +304,11 @@ public class GeneralPreferencesFragment extends PreferenceFragment // Enable bookmark sync on all accounts Account[] accounts = (Account[]) getArguments().getParcelableArray("accounts"); for (Account account : accounts) { - ContentResolver.setIsSyncable(account, BrowserContract.AUTHORITY, 1); + if (ContentResolver.getIsSyncable(account, BrowserContract.AUTHORITY) == 0) { + // Account wasn't syncable, enable it + ContentResolver.setIsSyncable(account, BrowserContract.AUTHORITY, 1); + ContentResolver.setSyncAutomatically(account, BrowserContract.AUTHORITY, true); + } } dismiss(); |
