Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +7 −0 Original line number Diff line number Diff line Loading @@ -2027,6 +2027,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mAuthController.addCallback(new AuthController.Callback() { @Override public void onAllAuthenticatorsRegistered() { mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE)); } @Override Loading Loading @@ -2156,6 +2157,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab return; } // don't start running fingerprint until they're registered if (!mAuthController.areAllAuthenticatorsRegistered()) { return; } final boolean shouldListenForFingerprint = shouldListenForFingerprint(isUdfpsSupported()); final boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING || mFingerprintRunningState == BIOMETRIC_STATE_CANCELLING_RESTARTING; Loading Loading @@ -3523,6 +3528,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab final int strongAuthFlags = mStrongAuthTracker.getStrongAuthForUser(userId); BiometricAuthenticated fingerprint = mUserFingerprintAuthenticated.get(userId); pw.println(" Fingerprint state (user=" + userId + ")"); pw.println(" areAllAuthenticatorsRegistered=" + mAuthController.areAllAuthenticatorsRegistered()); pw.println(" allowed=" + (fingerprint != null && isUnlockingWithBiometricAllowed(fingerprint.mIsStrongBiometric))); Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +9 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba @NonNull private final SparseBooleanArray mUdfpsEnrolledForUser; @NonNull private final SensorPrivacyManager mSensorPrivacyManager; private final WakefulnessLifecycle mWakefulnessLifecycle; private boolean mAllAuthenticatorsRegistered; private class BiometricTaskStackListener extends TaskStackListener { @Override Loading Loading @@ -226,6 +227,13 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba } } /** * Whether all authentictors have been registered. */ public boolean areAllAuthenticatorsRegistered() { return mAllAuthenticatorsRegistered; } private void handleAllAuthenticatorsRegistered( List<FingerprintSensorPropertiesInternal> sensors) { mExecution.assertIsMainThread(); Loading @@ -233,6 +241,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba Log.d(TAG, "handleAllAuthenticatorsRegistered | sensors: " + Arrays.toString( sensors.toArray())); } mAllAuthenticatorsRegistered = true; mFpProps = sensors; List<FingerprintSensorPropertiesInternal> udfpsProps = new ArrayList<>(); List<FingerprintSensorPropertiesInternal> sidefpsProps = new ArrayList<>(); Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,9 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { verify(mStatusBarStateController).addCallback(mStatusBarStateListenerCaptor.capture()); mStatusBarStateListener = mStatusBarStateListenerCaptor.getValue(); mKeyguardUpdateMonitor.registerCallback(mTestCallback); mTestableLooper.processAllMessages(); when(mAuthController.areAllAuthenticatorsRegistered()).thenReturn(true); } @After Loading Loading @@ -470,6 +473,18 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { verify(mFingerprintManager, never()).detectFingerprint(any(), any(), anyInt()); } @Test public void test_doesNotTryToAuthenticateFingerprint_whenAuthenticatorsNotRegistered() { when(mAuthController.areAllAuthenticatorsRegistered()).thenReturn(false); mKeyguardUpdateMonitor.dispatchStartedGoingToSleep(0 /* why */); mTestableLooper.processAllMessages(); verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(), anyInt(), anyInt()); verify(mFingerprintManager, never()).detectFingerprint(any(), any(), anyInt()); } @Test public void testFingerprintDoesNotAuth_whenEncrypted() { testFingerprintWhenStrongAuth( Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +7 −0 Original line number Diff line number Diff line Loading @@ -2027,6 +2027,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mAuthController.addCallback(new AuthController.Callback() { @Override public void onAllAuthenticatorsRegistered() { mainExecutor.execute(() -> updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE)); } @Override Loading Loading @@ -2156,6 +2157,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab return; } // don't start running fingerprint until they're registered if (!mAuthController.areAllAuthenticatorsRegistered()) { return; } final boolean shouldListenForFingerprint = shouldListenForFingerprint(isUdfpsSupported()); final boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING || mFingerprintRunningState == BIOMETRIC_STATE_CANCELLING_RESTARTING; Loading Loading @@ -3523,6 +3528,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab final int strongAuthFlags = mStrongAuthTracker.getStrongAuthForUser(userId); BiometricAuthenticated fingerprint = mUserFingerprintAuthenticated.get(userId); pw.println(" Fingerprint state (user=" + userId + ")"); pw.println(" areAllAuthenticatorsRegistered=" + mAuthController.areAllAuthenticatorsRegistered()); pw.println(" allowed=" + (fingerprint != null && isUnlockingWithBiometricAllowed(fingerprint.mIsStrongBiometric))); Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +9 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba @NonNull private final SparseBooleanArray mUdfpsEnrolledForUser; @NonNull private final SensorPrivacyManager mSensorPrivacyManager; private final WakefulnessLifecycle mWakefulnessLifecycle; private boolean mAllAuthenticatorsRegistered; private class BiometricTaskStackListener extends TaskStackListener { @Override Loading Loading @@ -226,6 +227,13 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba } } /** * Whether all authentictors have been registered. */ public boolean areAllAuthenticatorsRegistered() { return mAllAuthenticatorsRegistered; } private void handleAllAuthenticatorsRegistered( List<FingerprintSensorPropertiesInternal> sensors) { mExecution.assertIsMainThread(); Loading @@ -233,6 +241,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba Log.d(TAG, "handleAllAuthenticatorsRegistered | sensors: " + Arrays.toString( sensors.toArray())); } mAllAuthenticatorsRegistered = true; mFpProps = sensors; List<FingerprintSensorPropertiesInternal> udfpsProps = new ArrayList<>(); List<FingerprintSensorPropertiesInternal> sidefpsProps = new ArrayList<>(); Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,9 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { verify(mStatusBarStateController).addCallback(mStatusBarStateListenerCaptor.capture()); mStatusBarStateListener = mStatusBarStateListenerCaptor.getValue(); mKeyguardUpdateMonitor.registerCallback(mTestCallback); mTestableLooper.processAllMessages(); when(mAuthController.areAllAuthenticatorsRegistered()).thenReturn(true); } @After Loading Loading @@ -470,6 +473,18 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { verify(mFingerprintManager, never()).detectFingerprint(any(), any(), anyInt()); } @Test public void test_doesNotTryToAuthenticateFingerprint_whenAuthenticatorsNotRegistered() { when(mAuthController.areAllAuthenticatorsRegistered()).thenReturn(false); mKeyguardUpdateMonitor.dispatchStartedGoingToSleep(0 /* why */); mTestableLooper.processAllMessages(); verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(), anyInt(), anyInt()); verify(mFingerprintManager, never()).detectFingerprint(any(), any(), anyInt()); } @Test public void testFingerprintDoesNotAuth_whenEncrypted() { testFingerprintWhenStrongAuth( Loading