OSDN Git Service

Don't show security method until we actually return from the camera
authorJim Miller <jaggies@google.com>
Thu, 1 Nov 2012 02:44:56 +0000 (19:44 -0700)
committerJim Miller <jaggies@google.com>
Fri, 2 Nov 2012 05:11:42 +0000 (22:11 -0700)
This was causing problems because face unlock and the camera app are
competing for the camera.

The solution is to not show the security method until we get back to
keyguard.

Change-Id: I179548e4ee6aa0ab5dad545842ddeb14bc3b58e1

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

index 18f8b0c..86f3259 100644 (file)
@@ -584,6 +584,8 @@ public class KeyguardHostView extends KeyguardViewBase {
         }
     };
 
+    protected boolean mShowSecurityWhenReturn;
+
     @Override
     public void reset() {
         mIsVerifyUnlockOnly = false;
@@ -835,14 +837,10 @@ public class KeyguardHostView extends KeyguardViewBase {
                 if (isCameraPage(mAppWidgetContainer.getCurrentPage())) {
                     mAppWidgetContainer.scrollLeft();
                 }
-                SlidingChallengeLayout slider = locateSlider();
-                if (slider != null) {
-                    slider.setHandleAlpha(1);
-                    slider.showChallenge(true);
-                }
+                mShowSecurityWhenReturn = true;
             }
 
-            private SlidingChallengeLayout locateSlider() {
+            public SlidingChallengeLayout locateSlider() {
                 return (SlidingChallengeLayout) findViewById(R.id.sliding_layout);
             }
         };
@@ -1139,6 +1137,14 @@ public class KeyguardHostView extends KeyguardViewBase {
         if (DEBUG) Log.d(TAG, "Window is " + (hasWindowFocus ? "focused" : "unfocused"));
         if (!hasWindowFocus) {
             saveStickyWidgetIndex();
+        } else if (mShowSecurityWhenReturn) {
+            SlidingChallengeLayout slider =
+                (SlidingChallengeLayout) findViewById(R.id.sliding_layout);
+            if (slider != null) {
+                slider.setHandleAlpha(1);
+                slider.showChallenge(true);
+            }
+            mShowSecurityWhenReturn = false;
         }
     }