summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/CryptKeeper.java
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2014-08-28 15:56:38 -0700
committerRom Lemarchand <romlem@google.com>2014-09-02 18:26:38 +0000
commit87abbd3ea06a4901a4a967ce01e9fded356ae75f (patch)
tree417807f58ee82b5b3ed6af2a8ca81d62420edcc4 /src/com/android/settings/CryptKeeper.java
parentbde55601ba5695894b7f9b8c7f61fd6694f9b459 (diff)
downloadpackages_apps_Settings-87abbd3ea06a4901a4a967ce01e9fded356ae75f.zip
packages_apps_Settings-87abbd3ea06a4901a4a967ce01e9fded356ae75f.tar.gz
packages_apps_Settings-87abbd3ea06a4901a4a967ce01e9fded356ae75f.tar.bz2
Get correct factory reset reason from encryption failure
Requires matching framework change https://googleplex-android-review.git.corp.google.com/#/c/535832/ Bug: 17213613 Change-Id: Ia8006f4a9cb5909d83f1848d9acfbc3f1e0ab5fb
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r--src/com/android/settings/CryptKeeper.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 9a09647..7e92cc6 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -117,6 +117,8 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
private boolean mValidationRequested;
/** A flag to indicate that the volume is in a bad state (e.g. partially encrypted). */
private boolean mEncryptionGoneBad;
+ /** If gone bad, should we show encryption failed (false) or corrupt (true)*/
+ private boolean mCorrupt;
/** A flag to indicate when the back event should be ignored */
private boolean mIgnoreBack = false;
private int mCooldown;
@@ -224,12 +226,14 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
}
private class ValidationTask extends AsyncTask<Void, Void, Boolean> {
+ int state;
+
@Override
protected Boolean doInBackground(Void... params) {
final IMountService service = getMountService();
try {
Log.d(TAG, "Validating encryption state.");
- int state = service.getEncryptionState();
+ state = service.getEncryptionState();
if (state == IMountService.ENCRYPTION_STATE_NONE) {
Log.w(TAG, "Unexpectedly in CryptKeeper even though there is no encryption.");
return true; // Unexpected, but fine, I guess...
@@ -247,6 +251,7 @@ 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;
+ mCorrupt = state == IMountService.ENCRYPTION_STATE_ERROR_CORRUPT;
} else {
Log.d(TAG, "Encryption state validated. Proceeding to configure UI");
}
@@ -403,7 +408,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
private void setupUi() {
if (mEncryptionGoneBad || isDebugView(FORCE_VIEW_ERROR)) {
setContentView(R.layout.crypt_keeper_progress);
- showFactoryReset(false);
+ showFactoryReset(mCorrupt);
return;
}