Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2351)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java

Issue 1101373002: [Sync] Fix passphrase prompt for legacy accounts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lint Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java
index d3f8549cb2ba18d7dc549ee45e96a638c99cbf09..bf3117e75c66ab7fc03326acaa02256d7c64fa3c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/SyncCustomizationFragment.java
@@ -292,13 +292,8 @@ public class SyncCustomizationFragment extends PreferenceFragment implements
return;
}
if (mProfileSyncService.isPassphraseRequiredForDecryption() && isAdded()) {
- if (mProfileSyncService.isUsingSecondaryPassphrase()) {
- mSyncEncryption.setSummary(
- errorSummary(getString(R.string.sync_need_passphrase)));
- } else {
- mSyncEncryption.setSummary(
- errorSummary(getString(R.string.sync_need_password)));
- }
+ mSyncEncryption.setSummary(
+ errorSummary(getString(R.string.sync_need_passphrase)));
}
}
@@ -434,11 +429,7 @@ public class SyncCustomizationFragment extends PreferenceFragment implements
@Override
public void onPassphraseEntered(String passphrase, boolean isGaia, boolean isUpdate) {
if (isUpdate) {
- if (isGaia) {
- handleEncryptWithGaia(passphrase);
- } else {
- handleEncryptWithCustomPassphrase(passphrase);
- }
+ handleEncryptWithCustomPassphrase(passphrase);
maxbogue 2015/04/28 00:40:26 isUpdate is always false after this CL. Please rem
} else {
handleDecryption(passphrase);
}
@@ -467,25 +458,13 @@ public class SyncCustomizationFragment extends PreferenceFragment implements
@Override
public void onPassphraseTypeSelected(PassphraseType type) {
nyquist 2015/04/28 00:36:33 Can this argument go away now? If so, there might
boolean isAllDataEncrypted = mProfileSyncService.isEncryptEverythingEnabled();
- boolean isPassphraseGaia = !mProfileSyncService.isUsingSecondaryPassphrase();
-
- if (type == PassphraseType.IMPLICIT_PASSPHRASE) {
maxbogue 2015/04/28 00:40:26 I assumed from the code that at some point in time
- // custom passphrase -> gaia is not allowed
- assert (isPassphraseGaia);
- boolean isGaia = true;
- boolean isUpdate = !isAllDataEncrypted;
- displayPasswordDialog(isGaia, isUpdate);
- } else if (type == PassphraseType.CUSTOM_PASSPHRASE) {
- if (isPassphraseGaia) {
- displayCustomPasswordDialog();
- } else {
- // Now using the existing custom passphrase to encrypt
- // everything.
- boolean isGaia = false;
- boolean isUpdate = false;
- displayPasswordDialog(isGaia, isUpdate);
- }
- }
+ boolean isUsingSecondaryPassphrase = mProfileSyncService.isUsingSecondaryPassphrase();
+
+ // The passphrase type should only ever be selected if the account doesn't have
+ // full encryption enabled. Otherwise both options should be disabled.
+ assert !isAllDataEncrypted;
+ assert !isUsingSecondaryPassphrase;
+ displayCustomPasswordDialog();
}
/**
@@ -500,7 +479,7 @@ public class SyncCustomizationFragment extends PreferenceFragment implements
}
if (preference == mSyncEncryption && mProfileSyncService.isSyncInitialized()) {
if (mProfileSyncService.isPassphraseRequiredForDecryption()) {
- displayPasswordDialog(!mProfileSyncService.isUsingSecondaryPassphrase(), false);
+ displayPasswordDialog(false, false);
} else {
displayPasswordTypeDialog();
return true;

Powered by Google App Engine
This is Rietveld 408576698