Skip to content

Commit e23ab8b

Browse files
author
Jim Miller
committed
Selectively enable back button in keyguard for security screens.
This enables the back button on secure keyguard screens so the user can get back to the initial screen. Partial fix for bug 7094419 Change-Id: I4dc0ac8facfd2930ccb60710c36015ec1d2c8aa6
1 parent b45965f commit e23ab8b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public void show() {
174174
});
175175
}
176176
updateSecurityViews();
177+
setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
177178
}
178179

179180
private void updateSecurityViews() {
@@ -553,9 +554,13 @@ private void showSecurityScreen(SecurityMode securityMode) {
553554
}
554555
}
555556

556-
// Discard current runnable if we're switching back to the selector view
557+
557558
if (securityMode == SecurityMode.None) {
559+
// Discard current runnable if we're switching back to the selector view
558560
setOnDismissRunnable(null);
561+
setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
562+
} else {
563+
setSystemUiVisibility(getSystemUiVisibility() & (~View.STATUS_BAR_DISABLE_BACK));
559564
}
560565

561566
mCurrentSecuritySelection = securityMode;

policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public synchronized void show() {
9090
maybeCreateKeyguardLocked(enableScreenRotation);
9191
maybeEnableScreenRotation(enableScreenRotation);
9292

93-
// Disable aspects of the system/status/navigation bars that are not appropriate or
94-
// useful for the lockscreen but can be re-shown by dialogs or SHOW_WHEN_LOCKED activities.
95-
// Other disabled bits are handled by the KeyguardViewMediator talking directly to the
96-
// status bar service.
97-
int visFlags = View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_HOME;
93+
// Disable common aspects of the system/status/navigation bars that are not appropriate or
94+
// useful on any keyguard screen but can be re-shown by dialogs or SHOW_WHEN_LOCKED
95+
// activities. Other disabled bits are handled by the KeyguardViewMediator talking
96+
// directly to the status bar service.
97+
final int visFlags = View.STATUS_BAR_DISABLE_HOME;
9898
if (DEBUG) Log.v(TAG, "KGVM: Set visibility on " + mKeyguardHost + " to " + visFlags);
9999
mKeyguardHost.setSystemUiVisibility(visFlags);
100100

policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,9 @@ private void adjustStatusBarLocked() {
12561256
// windows that appear on top, ever
12571257
int flags = StatusBarManager.DISABLE_NONE;
12581258
if (mShowing) {
1259-
// disable navigation status bar components (home, recents) if lock screen is up
1259+
// Permanently disable components not available when keyguard is enabled
1260+
// (like recents). Temporary enable/disable (e.g. the "back" button) are
1261+
// done in KeyguardHostView.
12601262
flags |= StatusBarManager.DISABLE_RECENT;
12611263
if (isSecure() || !ENABLE_INSECURE_STATUS_BAR_EXPAND) {
12621264
// showing secure lockscreen; disable expanding.

0 commit comments

Comments
 (0)