Commit 75b46d5b authored by Boris Sazonov's avatar Boris Sazonov Committed by Chromium LUCI CQ

[Android] Fix isSyncingUrlsWithKeystorePassphrase for MobileIdentityConsistency

If MobileIdentityConsistency, isSyncingUrlsWithKeystorePassphrase should
also check that sync is enabled.

Bug: 1157046
Change-Id: Ia396b22a08d77f336ac8874f9940cf840ce60301
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2579785
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835250}
parent aa3c726a
...@@ -12,6 +12,7 @@ import androidx.annotation.VisibleForTesting; ...@@ -12,6 +12,7 @@ import androidx.annotation.VisibleForTesting;
import org.chromium.base.Log; import org.chromium.base.Log;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.uid.UniqueIdentificationGenerator; import org.chromium.chrome.browser.uid.UniqueIdentificationGenerator;
import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory; import org.chromium.chrome.browser.uid.UniqueIdentificationGeneratorFactory;
...@@ -164,6 +165,14 @@ public class SyncController ...@@ -164,6 +165,14 @@ public class SyncController
* @return Whether sync is enabled to sync urls or open tabs with a non custom passphrase. * @return Whether sync is enabled to sync urls or open tabs with a non custom passphrase.
*/ */
public boolean isSyncingUrlsWithKeystorePassphrase() { public boolean isSyncingUrlsWithKeystorePassphrase() {
if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
return mProfileSyncService.isEngineInitialized()
&& mProfileSyncService.getActiveDataTypes().contains(ModelType.TYPED_URLS)
&& (mProfileSyncService.getPassphraseType()
== PassphraseType.KEYSTORE_PASSPHRASE
|| mProfileSyncService.getPassphraseType()
== PassphraseType.TRUSTED_VAULT_PASSPHRASE);
}
return mProfileSyncService.isEngineInitialized() return mProfileSyncService.isEngineInitialized()
&& mProfileSyncService.getPreferredDataTypes().contains(ModelType.TYPED_URLS) && mProfileSyncService.getPreferredDataTypes().contains(ModelType.TYPED_URLS)
&& (mProfileSyncService.getPassphraseType() == PassphraseType.KEYSTORE_PASSPHRASE && (mProfileSyncService.getPassphraseType() == PassphraseType.KEYSTORE_PASSPHRASE
......
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