summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/CryptKeeper.java
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2014-03-14 09:20:24 -0700
committerPaul Lawrence <paullawrence@google.com>2014-03-14 09:20:24 -0700
commit2daf2641d364683c21bcbae08a3358d0f3c6af94 (patch)
tree8e13bdd5f269603f940375eae001595423103619 /src/com/android/settings/CryptKeeper.java
parentecc47ce16fceba94f150ff02f7c3ad7f2aa8404c (diff)
downloadpackages_apps_Settings-2daf2641d364683c21bcbae08a3358d0f3c6af94.zip
packages_apps_Settings-2daf2641d364683c21bcbae08a3358d0f3c6af94.tar.gz
packages_apps_Settings-2daf2641d364683c21bcbae08a3358d0f3c6af94.tar.bz2
Handle pattern cooldown correctly
We need to disable pattern control when in cooldown. We also need to hide the back button completely in pattern mode. Bug: 13329798 Change-Id: Idefea60d95db1810d340c69cc730a286011363db
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r--src/com/android/settings/CryptKeeper.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index d974d00..352fbd9 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -174,6 +174,9 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
// Factory reset the device.
sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
} else if ((failedAttempts % COOL_DOWN_ATTEMPTS) == 0) {
+ if (mLockPatternView != null) {
+ mLockPatternView.clearPattern();
+ }
mCooldown = COOL_DOWN_INTERVAL;
cooldown();
} else {
@@ -183,6 +186,9 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
if (mPasswordEntry != null) {
mPasswordEntry.setEnabled(true);
}
+ if (mLockPatternView != null) {
+ mLockPatternView.setEnabled(true);
+ }
}
}
}
@@ -373,6 +379,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
setContentView(R.layout.crypt_keeper_pin_entry);
} else if (type == StorageManager.CRYPT_TYPE_PATTERN) {
setContentView(R.layout.crypt_keeper_pattern_entry);
+ setBackFunctionality(false);
} else {
setContentView(R.layout.crypt_keeper_password_entry);
}
@@ -498,8 +505,13 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
if (mCooldown <= 0) {
// Re-enable the password entry and back presses.
- mPasswordEntry.setEnabled(true);
- setBackFunctionality(true);
+ if (mPasswordEntry != null) {
+ mPasswordEntry.setEnabled(true);
+ setBackFunctionality(true);
+ }
+ if (mLockPatternView != null) {
+ mLockPatternView.setEnabled(true);
+ }
status.setText(R.string.enter_password);
} else {
CharSequence template = getText(R.string.crypt_keeper_cooldown);
@@ -537,6 +549,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
@Override
public void onPatternDetected(List<LockPatternView.Cell> pattern) {
+ mLockPatternView.setEnabled(false);
new DecryptTask().execute(LockPatternUtils.patternToString(pattern));
}