Commit 54d6c376 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Unity][Android] Disable "Activity and interactions" if custom passphrase is set

This CL disables "Activity and interactions" entry in "Sync and Google
services" preference screen when custom passphrase is set.

Bug: 882463
Change-Id: I1c882e6d6ecafc2f17d8e43801851002155974df
Reviewed-on: https://chromium-review.googlesource.com/1216822Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589955}
parent 44528dd5
......@@ -689,6 +689,8 @@ public class SyncAndServicesPreferences extends PreferenceFragment
boolean syncEverything = mUseSyncAndAllServices.isChecked();
boolean passwordSyncConfigurable = mProfileSyncService.isEngineInitialized()
&& mProfileSyncService.isCryptographerReady();
boolean hasCustomPassphrase = mProfileSyncService.isEngineInitialized()
&& mProfileSyncService.getPassphraseType() == PassphraseType.CUSTOM_PASSPHRASE;
Set<Integer> syncTypes = mProfileSyncService.getPreferredDataTypes();
boolean syncAutofill = syncTypes.contains(ModelType.AUTOFILL);
for (CheckBoxPreference pref : mSyncAllTypes) {
......@@ -698,6 +700,7 @@ public class SyncAndServicesPreferences extends PreferenceFragment
if (pref == mSyncPaymentsIntegration) {
canSyncType = syncAutofill || syncEverything;
}
if (pref == mSyncActivityAndInteractions) canSyncType = !hasCustomPassphrase;
if (syncEverything) {
pref.setChecked(canSyncType);
......@@ -717,7 +720,8 @@ public class SyncAndServicesPreferences extends PreferenceFragment
passwordSyncConfigurable && syncTypes.contains(ModelType.PASSWORDS));
mSyncRecentTabs.setChecked(syncTypes.contains(ModelType.PROXY_TABS));
mSyncSettings.setChecked(syncTypes.contains(ModelType.PREFERENCES));
mSyncActivityAndInteractions.setChecked(syncTypes.contains(ModelType.USER_EVENTS));
mSyncActivityAndInteractions.setChecked(
!hasCustomPassphrase && syncTypes.contains(ModelType.USER_EVENTS));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment