Remove Chrome from Android's list of auto-sync apps
After this CL, when DecoupleSyncFromAndroidMasterSync is enabled, Chrome will no longer be in the list of auto-sync apps. In particular this toggle will disappear [1]. Users who previously disabled that toggle will remain with Chrome Sync disabled until they enable it again on Chrome settings. [1] https://screenshot.googleplex.com/9uR0qxTzVzK Context: the Android APIs setIsSyncable(..., int) and setSyncAutomatically(..., bool) control 2 *independent* settings per (account, app) pair, "syncable"[2] and "enabled"[3], persisted to an XML file. The first one controls whether the toggle in the screenshot will exist. A value >0 means yes, =0 means no and <0 means an unknown state (where the toggle isn't shown either)[4]. What the CL does is basically set "syncable" to 0 for any Chrome account. "enabled" can continue to be set safely and will still mirror the sync.requested pref [5], as happens today. [2] https://cs.android.com/android/platform/superproject/+/eed78aea1f49cba01c737220a6f834bca7feeef7:frameworks/base/services/core/java/com/android/server/content/SyncStorageEngine.java;l=283 [3] https://cs.android.com/android/platform/superproject/+/eed78aea1f49cba01c737220a6f834bca7feeef7:frameworks/base/services/core/java/com/android/server/content/SyncStorageEngine.java;l=282 [4] https://developer.android.com/reference/android/content/ContentResolver#setIsSyncable(android.accounts.Account,%20java.lang.String,%20int) [5] https://source.chromium.org/chromium/chromium/src/+/master:components/sync/base/sync_prefs.h;l=90 The CL also: a) Replaces code that checked specifically whether "syncable" valued 1, 0 or -1 with more generic checks for >0, =0 or <0. 1, 0 and -1 do have special meanings in SyncStorageEngine, but that's an implementation detail of a lower layer. The layer where the APIs live (ContentResolver) never ensures those values. b) Modifies the implementation of MockSyncContentResolverDelegate to be more consistent with the real Android behavior. E.g. one should be allowed to set "enabled" before "syncable". In next CLs the DecoupleSyncFromAndroidMasterSync feature toggle will be renamed to mention auto-sync rather than master sync. Bug: 1105795 Change-Id: I091981506ff64c33a6c259862eee07d28825527f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366895 Commit-Queue: Victor Vianna <victorvianna@google.com> Reviewed-by:Marc Treib <treib@chromium.org> Cr-Commit-Position: refs/heads/master@{#800273}
Showing
Please register or sign in to comment