summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/CryptKeeper.java
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2014-08-20 07:43:32 -0700
committerPaul Lawrence <paullawrence@google.com>2014-08-21 15:41:42 -0700
commit0f11e15f503d65d5a085157d8ec406a72d712ce7 (patch)
tree8a13033d6c1ba9a8a1c5c076103be5f8c0ca6844 /src/com/android/settings/CryptKeeper.java
parentff2da2cdb332be35bc94e3e66a10d55fe7bb0105 (diff)
downloadpackages_apps_Settings-0f11e15f503d65d5a085157d8ec406a72d712ce7.zip
packages_apps_Settings-0f11e15f503d65d5a085157d8ec406a72d712ce7.tar.gz
packages_apps_Settings-0f11e15f503d65d5a085157d8ec406a72d712ce7.tar.bz2
Honor hide pattern on crypto screen
Also clear pattern a little more quickly, and show owner info even from before encrypting (since we're fixing pattern visible, we should fix owner info too in the same way) Bug: 17059314 Change-Id: Ie9ccd4a892a1dec32ebe60567d3b72dd6fe25060
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r--src/com/android/settings/CryptKeeper.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index c2295e6..bff75fb 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -133,6 +133,9 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
// how long we wait to clear a wrong pattern
private static final int WRONG_PATTERN_CLEAR_TIMEOUT_MS = 1500;
+ // how long we wait to clear a right pattern
+ private static final int RIGHT_PATTERN_CLEAR_TIMEOUT_MS = 500;
+
private Runnable mClearPatternRunnable = new Runnable() {
public void run() {
mLockPatternView.clearPattern();
@@ -167,6 +170,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
if (failedAttempts == 0) {
// The password was entered successfully. Simply do nothing
// and wait for the service restart to switch to surfacefligner
+ if (mLockPatternView != null) {
+ mLockPatternView.removeCallbacks(mClearPatternRunnable);
+ mLockPatternView.postDelayed(mClearPatternRunnable, RIGHT_PATTERN_CLEAR_TIMEOUT_MS);
+ }
} else if (failedAttempts == MAX_FAILED_ATTEMPTS) {
// Factory reset the device.
sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
@@ -409,6 +416,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
new AsyncTask<Void, Void, Void>() {
int type = StorageManager.CRYPT_TYPE_PASSWORD;
String owner_info;
+ boolean pattern_visible;
@Override
public Void doInBackground(Void... v) {
@@ -416,6 +424,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
final IMountService service = getMountService();
type = service.getPasswordType();
owner_info = service.getField("OwnerInfo");
+ pattern_visible = !("0".equals(service.getField("PatternVisible")));
} catch (Exception e) {
Log.e(TAG, "Error calling mount service " + e);
}
@@ -445,6 +454,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList
passwordEntryInit();
+ if (mLockPatternView != null) {
+ mLockPatternView.setInStealthMode(!pattern_visible);
+ }
+
if (mCooldown > 0) {
setBackFunctionality(false);
cooldown(); // in case we are cooling down and coming back from emergency dialler