summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-03-14 19:55:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-14 19:55:17 +0000
commitadb9554d993a8510bfc3866538faaa042d629731 (patch)
treebc41596e1bb2ebe7998ae0805dc99fa9e1920c54
parent0060deb6edecd47967e8c05d41595170188a49fe (diff)
parent03eca859067ac0d4e419305de8ab0fdc03b4210f (diff)
downloadframeworks_base-adb9554d993a8510bfc3866538faaa042d629731.zip
frameworks_base-adb9554d993a8510bfc3866538faaa042d629731.tar.gz
frameworks_base-adb9554d993a8510bfc3866538faaa042d629731.tar.bz2
Merge "Enable back button in keyguard security account mode." into jb-mr2-dev
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java21
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;