OSDN Git Service

Selectively enable back button in keyguard for security screens.
authorJim Miller <jaggies@google.com>
Sun, 16 Sep 2012 22:45:44 +0000 (15:45 -0700)
committerJim Miller <jaggies@google.com>
Sun, 16 Sep 2012 22:50:37 +0000 (15:50 -0700)
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

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

index 955c230..a494029 100644 (file)
@@ -174,6 +174,7 @@ public class KeyguardHostView extends KeyguardViewBase {
             });
         }
         updateSecurityViews();
+        setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
     }
 
     private void updateSecurityViews() {
@@ -553,9 +554,13 @@ public class KeyguardHostView extends KeyguardViewBase {
             }
         }
 
-        // Discard current runnable if we're switching back to the selector view
+
         if (securityMode == SecurityMode.None) {
+            // Discard current runnable if we're switching back to the selector view
             setOnDismissRunnable(null);
+            setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_BACK);
+        } else {
+            setSystemUiVisibility(getSystemUiVisibility() & (~View.STATUS_BAR_DISABLE_BACK));
         }
 
         mCurrentSecuritySelection = securityMode;
index d9088e0..4032db0 100644 (file)
@@ -90,11 +90,11 @@ public class KeyguardViewManager {
         maybeCreateKeyguardLocked(enableScreenRotation);
         maybeEnableScreenRotation(enableScreenRotation);
 
-        // Disable aspects of the system/status/navigation bars that are not appropriate or
-        // useful for the lockscreen but can be re-shown by dialogs or SHOW_WHEN_LOCKED activities.
-        // Other disabled bits are handled by the KeyguardViewMediator talking directly to the
-        // status bar service.
-        int visFlags = View.STATUS_BAR_DISABLE_BACK | View.STATUS_BAR_DISABLE_HOME;
+        // Disable common aspects of the system/status/navigation bars that are not appropriate or
+        // useful on any keyguard screen but can be re-shown by dialogs or SHOW_WHEN_LOCKED
+        // activities. Other disabled bits are handled by the KeyguardViewMediator talking
+        // directly to the status bar service.
+        final int visFlags = View.STATUS_BAR_DISABLE_HOME;
         if (DEBUG) Log.v(TAG, "KGVM: Set visibility on " + mKeyguardHost + " to " + visFlags);
         mKeyguardHost.setSystemUiVisibility(visFlags);
 
index 372b0fc..7f5a00e 100644 (file)
@@ -1256,7 +1256,9 @@ public class KeyguardViewMediator {
             // windows that appear on top, ever
             int flags = StatusBarManager.DISABLE_NONE;
             if (mShowing) {
-                // disable navigation status bar components (home, recents) if lock screen is up
+                // Permanently disable components not available when keyguard is enabled
+                // (like recents). Temporary enable/disable (e.g. the "back" button) are
+                // done in KeyguardHostView.
                 flags |= StatusBarManager.DISABLE_RECENT;
                 if (isSecure() || !ENABLE_INSECURE_STATUS_BAR_EXPAND) {
                     // showing secure lockscreen; disable expanding.