Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +13 −8 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.systemui.Flags.fingerprintCancelRaceMitigation; import static com.android.systemui.Flags.glanceableHubV2; import static com.android.systemui.Flags.simPinBouncerReset; import static com.android.systemui.Flags.simPinUseSlotId; Loading Loading @@ -276,13 +277,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt public static final int BIOMETRIC_HELP_FACE_NOT_RECOGNIZED = -2; public static final int BIOMETRIC_HELP_FACE_NOT_AVAILABLE = -3; /** * If no cancel signal has been received after this amount of time, set the biometric running * state to stopped to allow Keyguard to retry authentication. */ @VisibleForTesting protected static final int DEFAULT_CANCEL_SIGNAL_TIMEOUT = 3000; private static final ComponentName FALLBACK_HOME_COMPONENT = new ComponentName( "com.android.settings", "com.android.settings.FallbackHome"); Loading Loading @@ -406,6 +400,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt @DevicePostureInt protected int mConfigFaceAuthSupportedPosture; /** * If no cancel signal has been received after this amount of time, set the fingerprint running * state to stopped to allow Keyguard to retry authentication. */ private int mDefaultCancelSignalTimeout; private KeyguardBypassController mKeyguardBypassController; private List<SubscriptionInfo> mSubscriptionInfo; @VisibleForTesting Loading Loading @@ -2254,6 +2254,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt mBiometricManager = biometricManager; mConfigFaceAuthSupportedPosture = mContext.getResources().getInteger( R.integer.config_face_auth_supported_posture); mDefaultCancelSignalTimeout = 3000; if (fingerprintCancelRaceMitigation()) { mDefaultCancelSignalTimeout = 5000; } mFaceWakeUpTriggersConfig = faceWakeUpTriggersConfig; mAllowFingerprintOnOccludingActivitiesFromPackage = Arrays.stream( mContext.getResources().getStringArray( Loading Loading @@ -3238,7 +3242,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt mFingerprintCancelSignal.cancel(); mFingerprintCancelSignal = null; mHandler.removeCallbacks(mFpCancelNotReceived); mHandler.postDelayed(mFpCancelNotReceived, DEFAULT_CANCEL_SIGNAL_TIMEOUT); mHandler.postDelayed(mFpCancelNotReceived, mDefaultCancelSignalTimeout); } setFingerprintRunningState(BIOMETRIC_STATE_CANCELLING); } Loading Loading @@ -4227,6 +4231,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println("KeyguardUpdateMonitor state:"); pw.println(" mDefaultCancelSignalTimeout=" + mDefaultCancelSignalTimeout); pw.println(" forceIsDismissible=" + mForceIsDismissible); pw.println(" forceIsDismissibleIsKeepingDeviceUnlocked=" + forceIsDismissibleIsKeepingDeviceUnlocked()); Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.SOM import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING_RESTARTING; import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_STOPPED; import static com.android.keyguard.KeyguardUpdateMonitor.DEFAULT_CANCEL_SIGNAL_TIMEOUT; import static com.android.keyguard.KeyguardUpdateMonitor.HAL_POWER_PRESS_TIMEOUT; import static com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2; import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_OPENED; Loading @@ -50,6 +49,7 @@ import static kotlinx.coroutines.flow.StateFlowKt.MutableStateFlow; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; Loading Loading @@ -1793,8 +1793,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { mKeyguardUpdateMonitor.setKeyguardShowing(false, false); mTestableLooper.processAllMessages(); verify(mHandler).postDelayed(mKeyguardUpdateMonitor.mFpCancelNotReceived, DEFAULT_CANCEL_SIGNAL_TIMEOUT); verify(mHandler).postDelayed(eq(mKeyguardUpdateMonitor.mFpCancelNotReceived), anyLong()); mKeyguardUpdateMonitor.onFingerprintAuthenticated(0, true); mTestableLooper.processAllMessages(); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +13 −8 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.systemui.Flags.fingerprintCancelRaceMitigation; import static com.android.systemui.Flags.glanceableHubV2; import static com.android.systemui.Flags.simPinBouncerReset; import static com.android.systemui.Flags.simPinUseSlotId; Loading Loading @@ -276,13 +277,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt public static final int BIOMETRIC_HELP_FACE_NOT_RECOGNIZED = -2; public static final int BIOMETRIC_HELP_FACE_NOT_AVAILABLE = -3; /** * If no cancel signal has been received after this amount of time, set the biometric running * state to stopped to allow Keyguard to retry authentication. */ @VisibleForTesting protected static final int DEFAULT_CANCEL_SIGNAL_TIMEOUT = 3000; private static final ComponentName FALLBACK_HOME_COMPONENT = new ComponentName( "com.android.settings", "com.android.settings.FallbackHome"); Loading Loading @@ -406,6 +400,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt @DevicePostureInt protected int mConfigFaceAuthSupportedPosture; /** * If no cancel signal has been received after this amount of time, set the fingerprint running * state to stopped to allow Keyguard to retry authentication. */ private int mDefaultCancelSignalTimeout; private KeyguardBypassController mKeyguardBypassController; private List<SubscriptionInfo> mSubscriptionInfo; @VisibleForTesting Loading Loading @@ -2254,6 +2254,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt mBiometricManager = biometricManager; mConfigFaceAuthSupportedPosture = mContext.getResources().getInteger( R.integer.config_face_auth_supported_posture); mDefaultCancelSignalTimeout = 3000; if (fingerprintCancelRaceMitigation()) { mDefaultCancelSignalTimeout = 5000; } mFaceWakeUpTriggersConfig = faceWakeUpTriggersConfig; mAllowFingerprintOnOccludingActivitiesFromPackage = Arrays.stream( mContext.getResources().getStringArray( Loading Loading @@ -3238,7 +3242,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt mFingerprintCancelSignal.cancel(); mFingerprintCancelSignal = null; mHandler.removeCallbacks(mFpCancelNotReceived); mHandler.postDelayed(mFpCancelNotReceived, DEFAULT_CANCEL_SIGNAL_TIMEOUT); mHandler.postDelayed(mFpCancelNotReceived, mDefaultCancelSignalTimeout); } setFingerprintRunningState(BIOMETRIC_STATE_CANCELLING); } Loading Loading @@ -4227,6 +4231,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, CoreSt @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println("KeyguardUpdateMonitor state:"); pw.println(" mDefaultCancelSignalTimeout=" + mDefaultCancelSignalTimeout); pw.println(" forceIsDismissible=" + mForceIsDismissible); pw.println(" forceIsDismissibleIsKeepingDeviceUnlocked=" + forceIsDismissibleIsKeepingDeviceUnlocked()); Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.SOM import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_CANCELLING_RESTARTING; import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_STATE_STOPPED; import static com.android.keyguard.KeyguardUpdateMonitor.DEFAULT_CANCEL_SIGNAL_TIMEOUT; import static com.android.keyguard.KeyguardUpdateMonitor.HAL_POWER_PRESS_TIMEOUT; import static com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2; import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_OPENED; Loading @@ -50,6 +49,7 @@ import static kotlinx.coroutines.flow.StateFlowKt.MutableStateFlow; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; Loading Loading @@ -1793,8 +1793,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { mKeyguardUpdateMonitor.setKeyguardShowing(false, false); mTestableLooper.processAllMessages(); verify(mHandler).postDelayed(mKeyguardUpdateMonitor.mFpCancelNotReceived, DEFAULT_CANCEL_SIGNAL_TIMEOUT); verify(mHandler).postDelayed(eq(mKeyguardUpdateMonitor.mFpCancelNotReceived), anyLong()); mKeyguardUpdateMonitor.onFingerprintAuthenticated(0, true); mTestableLooper.processAllMessages(); Loading