diff options
author | John Spurlock <jspurlock@google.com> | 2013-03-14 14:21:04 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2013-03-14 15:23:35 -0400 |
commit | 03eca859067ac0d4e419305de8ab0fdc03b4210f (patch) | |
tree | d53d78ad97430b38b98849305b45a2c9c8b5899f /policy | |
parent | 7534707b34ad7f2c8d3954d0fe8d2e6e7fcb2fc6 (diff) | |
download | frameworks_base-03eca859067ac0d4e419305de8ab0fdc03b4210f.zip frameworks_base-03eca859067ac0d4e419305de8ab0fdc03b4210f.tar.gz frameworks_base-03eca859067ac0d4e419305de8ab0fdc03b4210f.tar.bz2 |
Enable back button in keyguard security account mode.
Otherwise hitting "Forgot Pattern" traps you in account mode.
Avoid the known case where account is not backup (if permanently
locked).
Bug: 8381295
Change-Id: Ifda28eec6d0609e822b210831ff0ea0ec6cb22b1
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 06f06b5..78d7caa 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -310,9 +310,7 @@ public class KeyguardHostView extends KeyguardViewBase { mKeyguardSelectorView = (KeyguardSelectorView) findViewById(R.id.keyguard_selector_view); mViewStateManager.setSecurityViewContainer(mSecurityViewContainer); - if (!(mContext instanceof Activity)) { - setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK); - } + setBackButtonEnabled(false); addDefaultWidgets(); @@ -329,6 +327,13 @@ public class KeyguardHostView extends KeyguardViewBase { updateSecurityViews(); } + private void setBackButtonEnabled(boolean enabled) { + if (mContext instanceof Activity) return; // always enabled in activity mode + setSystemUiVisibility(enabled ? + getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_BACK : + getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK); + } + private boolean shouldEnableAddWidget() { return numWidgets() < MAX_WIDGETS && mUserSetupCompleted; } @@ -907,6 +912,10 @@ public class KeyguardHostView extends KeyguardViewBase { // Discard current runnable if we're switching back to the selector view setOnDismissAction(null); } + if (securityMode == SecurityMode.Account && !mLockPatternUtils.isPermanentlyLocked()) { + // we're showing account as a backup, provide a way to get back to primary + setBackButtonEnabled(true); + } mCurrentSecuritySelection = securityMode; } @@ -1579,6 +1588,12 @@ public class KeyguardHostView extends KeyguardViewBase { } public boolean handleBackKey() { + if (mCurrentSecuritySelection == SecurityMode.Account) { + // go back to primary screen and re-disable back + setBackButtonEnabled(false); + showPrimarySecurityScreen(false /*turningOff*/); + return true; + } if (mCurrentSecuritySelection != SecurityMode.None) { mCallback.dismiss(false); return true; |