Merge "Decrease threshold for a consecutive UDFPS attempt"
This commit is contained in:
@@ -28,5 +28,6 @@
|
||||
<!-- Will display the bouncer on one side of the display, and the current user icon and
|
||||
user switcher on the other side -->
|
||||
<bool name="config_enableBouncerUserSwitcher">false</bool>
|
||||
|
||||
<!-- Time to be considered a consecutive fingerprint failure in ms -->
|
||||
<integer name="fp_consecutive_failure_time_ms">3500</integer>
|
||||
</resources>
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone;
|
||||
import static android.app.StatusBarManager.SESSION_KEYGUARD;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.hardware.biometrics.BiometricSourceType;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
@@ -45,6 +44,7 @@ import com.android.keyguard.KeyguardUpdateMonitor;
|
||||
import com.android.keyguard.KeyguardUpdateMonitorCallback;
|
||||
import com.android.keyguard.KeyguardViewController;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.biometrics.AuthController;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
@@ -163,7 +163,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
private final KeyguardStateController mKeyguardStateController;
|
||||
private final NotificationShadeWindowController mNotificationShadeWindowController;
|
||||
private final SessionTracker mSessionTracker;
|
||||
private final Context mContext;
|
||||
private final int mConsecutiveFpFailureThreshold;
|
||||
private final int mWakeUpDelay;
|
||||
private int mMode;
|
||||
private BiometricSourceType mBiometricType;
|
||||
@@ -266,7 +266,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
private KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
|
||||
|
||||
@Inject
|
||||
public BiometricUnlockController(Context context, DozeScrimController dozeScrimController,
|
||||
public BiometricUnlockController(DozeScrimController dozeScrimController,
|
||||
KeyguardViewMediator keyguardViewMediator, ScrimController scrimController,
|
||||
ShadeController shadeController,
|
||||
NotificationShadeWindowController notificationShadeWindowController,
|
||||
@@ -284,7 +284,6 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
KeyguardUnlockAnimationController keyguardUnlockAnimationController,
|
||||
SessionTracker sessionTracker,
|
||||
LatencyTracker latencyTracker) {
|
||||
mContext = context;
|
||||
mPowerManager = powerManager;
|
||||
mShadeController = shadeController;
|
||||
mUpdateMonitor = keyguardUpdateMonitor;
|
||||
@@ -302,6 +301,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
mKeyguardStateController = keyguardStateController;
|
||||
mHandler = handler;
|
||||
mWakeUpDelay = resources.getInteger(com.android.internal.R.integer.config_wakeUpDelayDoze);
|
||||
mConsecutiveFpFailureThreshold = resources.getInteger(
|
||||
R.integer.fp_consecutive_failure_time_ms);
|
||||
mKeyguardBypassController = keyguardBypassController;
|
||||
mKeyguardBypassController.setUnlockController(this);
|
||||
mMetricsLogger = metricsLogger;
|
||||
@@ -666,8 +667,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
if (biometricSourceType == BiometricSourceType.FINGERPRINT
|
||||
&& mUpdateMonitor.isUdfpsSupported()) {
|
||||
long currUptimeMillis = SystemClock.uptimeMillis();
|
||||
if (currUptimeMillis - mLastFpFailureUptimeMillis
|
||||
< (mStatusBarStateController.isDozing() ? 3500 : 2000)) {
|
||||
if (currUptimeMillis - mLastFpFailureUptimeMillis < mConsecutiveFpFailureThreshold) {
|
||||
mNumConsecutiveFpFailures += 1;
|
||||
} else {
|
||||
mNumConsecutiveFpFailures = 1;
|
||||
|
||||
@@ -126,10 +126,9 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
||||
.thenReturn(true);
|
||||
when(mAuthController.isUdfpsFingerDown()).thenReturn(false);
|
||||
when(mKeyguardBypassController.canPlaySubtleWindowAnimations()).thenReturn(true);
|
||||
mContext.addMockSystemService(PowerManager.class, mPowerManager);
|
||||
mDependency.injectTestDependency(NotificationMediaManager.class, mMediaManager);
|
||||
res.addOverride(com.android.internal.R.integer.config_wakeUpDelayDoze, 0);
|
||||
mBiometricUnlockController = new BiometricUnlockController(mContext, mDozeScrimController,
|
||||
mBiometricUnlockController = new BiometricUnlockController(mDozeScrimController,
|
||||
mKeyguardViewMediator, mScrimController, mShadeController,
|
||||
mNotificationShadeWindowController, mKeyguardStateController, mHandler,
|
||||
mUpdateMonitor, res.getResources(), mKeyguardBypassController, mDozeParameters,
|
||||
|
||||
Reference in New Issue
Block a user