diff options
author | Ben Komalo <benkomalo@google.com> | 2011-09-08 14:36:08 -0700 |
---|---|---|
committer | Ben Komalo <benkomalo@google.com> | 2011-09-11 17:16:27 -0700 |
commit | d4758efef6d6564d7b4b0b747d0a9ae9b44a38c7 (patch) | |
tree | 73c24ca58771518979139b4e805253e689e22441 /src/com/android/settings/CryptKeeper.java | |
parent | 782ed596ebb02245645466ae5972e06ce7daae9f (diff) | |
download | packages_apps_settings-d4758efef6d6564d7b4b0b747d0a9ae9b44a38c7.zip packages_apps_settings-d4758efef6d6564d7b4b0b747d0a9ae9b44a38c7.tar.gz packages_apps_settings-d4758efef6d6564d7b4b0b747d0a9ae9b44a38c7.tar.bz2 |
Don't try to talk to vold mid-encryption.
We were attempting to unconditionally validate the encryption state on
CryptKeeper bringup, which required MountService to talk to vold. For
some reason, during encryption, this cannot happen, and that call never
returns, so the CryptKeeper UI was never brought up.
Bug: 5276690
Change-Id: I6a146e25e24f4efd760b0afa1e1409bf9ea3e9c3
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r-- | src/com/android/settings/CryptKeeper.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index b1de932e7..ad2655f 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -88,6 +88,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList /** When encryption is detected, this flag indivates whether or not we've checked for erros. */ private boolean mValidationComplete; + private boolean mValidationRequested; /** A flag to indicate that the volume is in a bad state (e.g. partially encrypted). */ private boolean mEncryptionGoneBad; @@ -159,6 +160,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList protected Boolean doInBackground(Void... params) { IMountService service = getMountService(); try { + Log.d(TAG, "Validating encryption state."); int state = service.getEncryptionState(); if (state == IMountService.ENCRYPTION_STATE_NONE) { Log.w(TAG, "Unexpectedly in CryptKeeper even though there is no encryption."); @@ -177,6 +179,8 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList if (Boolean.FALSE.equals(result)) { Log.w(TAG, "Incomplete, or corrupted encryption detected. Prompting user to wipe."); mEncryptionGoneBad = true; + } else { + Log.d(TAG, "Encryption state validated. Proceeding to configure UI"); } setupUi(); } @@ -237,9 +241,6 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList mWakeLock = retained.wakelock; Log.d(TAG, "Restoring wakelock from NonConfigurationInstanceState"); } - - // Check the encryption status to ensure something hasn't gone bad. - new ValidationTask().execute((Void[]) null); } /** @@ -251,10 +252,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList public void onStart() { super.onStart(); - // Check to see why we were started. - if (mValidationComplete) { - setupUi(); - } + setupUi(); } /** @@ -272,9 +270,13 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList if (!"".equals(progress) || isDebugView(FORCE_VIEW_PROGRESS)) { setContentView(R.layout.crypt_keeper_progress); encryptionProgressInit(); - } else { + } else if (mValidationComplete) { setContentView(R.layout.crypt_keeper_password_entry); passwordEntryInit(); + } else if (!mValidationRequested) { + // We're supposed to be encrypted, but no validation has been done. + new ValidationTask().execute((Void[]) null); + mValidationRequested = true; } } |