OSDN Git Service

Only suppressing FUL on boot if selected fixes b/7338965
authorBrian Colonna <bcolonna@google.com>
Thu, 1 Nov 2012 20:20:24 +0000 (16:20 -0400)
committerBrian Colonna <bcolonna@google.com>
Thu, 1 Nov 2012 20:20:24 +0000 (16:20 -0400)
FUL is suppressed when first booted and unsuppressed when the user
leaves keyguard (by logging in or turning the screen off).  However,
if the user managed to enter the phone without going through
keyguard (security set to none, or initial device setup), FUL was
not being unsuppressed and it would not show up the first time the
user tried to use it.

This fix only suppresses FUL on first boot if it is the selected
security method.  Therefore, it is not suppressed the first time it
is used after setting it up.

Change-Id: I766bbce31ce3939de97661623fe3b8d3fa29c20d

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

index fe4ac5b..d0fa81e 100644 (file)
@@ -520,8 +520,22 @@ public class KeyguardViewMediator {
             mSystemReady = true;
             mUpdateMonitor.registerCallback(mUpdateCallback);
 
-            // Disable alternate unlock right after boot until things have settled.
-            mUpdateMonitor.setAlternateUnlockEnabled(false);
+            // Suppress biometric unlock right after boot until things have settled if it is the
+            // selected security method, otherwise unsuppress it.  It must be unsuppressed if it is
+            // not the selected security method for the following reason:  if the user starts
+            // without a screen lock selected, the biometric unlock would be suppressed the first
+            // time they try to use it.
+            //
+            // Note that the biometric unlock will still not show if it is not the selected method.
+            // Calling setAlternateUnlockEnabled(true) simply says don't suppress it if it is the
+            // selected method.
+            if (mLockPatternUtils.usingBiometricWeak()
+                    && mLockPatternUtils.isBiometricWeakInstalled()) {
+                if (DEBUG) Log.d(TAG, "suppressing biometric unlock during boot");
+                mUpdateMonitor.setAlternateUnlockEnabled(false);
+            } else {
+                mUpdateMonitor.setAlternateUnlockEnabled(true);
+            }
 
             doKeyguardLocked();
         }