| Index: sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java
|
| diff --git a/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java b/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java
|
| index 27de932d2dabe35eb349d792a142106fa466b5f1..2437953530e7e5bc822c5424e003222506c19ceb 100644
|
| --- a/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java
|
| +++ b/sync/android/java/src/org/chromium/sync/internal_api/pub/SyncDecryptionPassphraseType.java
|
| @@ -80,14 +80,21 @@ public enum SyncDecryptionPassphraseType implements Parcelable {
|
| return visibleTypes;
|
| }
|
|
|
| - public Set<SyncDecryptionPassphraseType> getAllowedTypes() {
|
| + /**
|
| + * Get the types that are allowed to be enabled from the current type.
|
| + *
|
| + * @param encryptEverythingAllowed Whether encrypting all data is allowed.
|
| + */
|
| + public Set<SyncDecryptionPassphraseType> getAllowedTypes(boolean encryptEverythingAllowed) {
|
| Set<SyncDecryptionPassphraseType> allowedTypes = new HashSet<>();
|
| switch (this) {
|
| case NONE: // Intentional fall through.
|
| case IMPLICIT_PASSPHRASE: // Intentional fall through.
|
| case KEYSTORE_PASSPHRASE:
|
| allowedTypes.add(this);
|
| - allowedTypes.add(CUSTOM_PASSPHRASE);
|
| + if (encryptEverythingAllowed) {
|
| + allowedTypes.add(CUSTOM_PASSPHRASE);
|
| + }
|
| break;
|
| case FROZEN_IMPLICIT_PASSPHRASE: // Intentional fall through.
|
| case CUSTOM_PASSPHRASE: // Intentional fall through.
|
| @@ -98,6 +105,14 @@ public enum SyncDecryptionPassphraseType implements Parcelable {
|
| return allowedTypes;
|
| }
|
|
|
| + /**
|
| + * TODO(maxbogue): Remove when no longer used in Clank; see http://crbug.com/424187.
|
| + */
|
| + @Deprecated
|
| + public Set<SyncDecryptionPassphraseType> getAllowedTypes() {
|
| + return getAllowedTypes(true);
|
| + }
|
| +
|
| public int internalValue() {
|
| // Since the values in this enums are constant and very small, this cast is safe.
|
| return mNativeValue;
|
|
|