Revert "Remove ScrimController from BiometricUnlockController"
Revert submission 20691780-cherrypick-modernize_alt_bouncer-2av1xvqe7q
Reason for revert: breaking build (see b/262237315)
Reverted Changes:
Ic4c4837cd:Remove ScrimController from BiometricUnlockControl...
I041db358a:Add entry for modern alternate bouncer toggle
I400a27e8f:Update ArcSBKVM constructor
Ia975fd65d:Modernize alternate bouncer logic
I0e15b8796:Update constructors
Change-Id: If24ae9d9fe1035e2af5b9c822cd1f66128f11823
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
index d240d5a..03057a4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
@@ -157,6 +157,7 @@
private KeyguardViewController mKeyguardViewController;
private DozeScrimController mDozeScrimController;
private KeyguardViewMediator mKeyguardViewMediator;
+ private ScrimController mScrimController;
private PendingAuthenticated mPendingAuthenticated = null;
private boolean mHasScreenTurnedOnSinceAuthenticating;
private boolean mFadedAwayAfterWakeAndUnlock;
@@ -255,7 +256,7 @@
@Inject
public BiometricUnlockController(
DozeScrimController dozeScrimController,
- KeyguardViewMediator keyguardViewMediator,
+ KeyguardViewMediator keyguardViewMediator, ScrimController scrimController,
NotificationShadeWindowController notificationShadeWindowController,
KeyguardStateController keyguardStateController, Handler handler,
KeyguardUpdateMonitor keyguardUpdateMonitor,
@@ -284,6 +285,7 @@
mNotificationShadeWindowController = notificationShadeWindowController;
mDozeScrimController = dozeScrimController;
mKeyguardViewMediator = keyguardViewMediator;
+ mScrimController = scrimController;
mKeyguardStateController = keyguardStateController;
mHandler = handler;
mConsecutiveFpFailureThreshold = resources.getInteger(
@@ -364,6 +366,12 @@
Trace.endSection();
}
+ private boolean pulsingOrAod() {
+ final ScrimState scrimState = mScrimController.getState();
+ return scrimState == ScrimState.AOD
+ || scrimState == ScrimState.PULSING;
+ }
+
@Override
public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType,
boolean isStrongBiometric) {
@@ -408,7 +416,7 @@
boolean wasDeviceInteractive = mUpdateMonitor.isDeviceInteractive();
mMode = mode;
mHasScreenTurnedOnSinceAuthenticating = false;
- if (mMode == MODE_WAKE_AND_UNLOCK_PULSING) {
+ if (mMode == MODE_WAKE_AND_UNLOCK_PULSING && pulsingOrAod()) {
// If we are waking the device up while we are pulsing the clock and the
// notifications would light up first, creating an unpleasant animation.
// Defer changing the screen brightness by forcing doze brightness on our window
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
index 9695000..868ae2b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
@@ -86,6 +86,8 @@
@Mock
private KeyguardViewMediator mKeyguardViewMediator;
@Mock
+ private ScrimController mScrimController;
+ @Mock
private BiometricUnlockController.BiometricModeListener mBiometricModeListener;
@Mock
private KeyguardStateController mKeyguardStateController;
@@ -131,7 +133,7 @@
when(mVibratorHelper.hasVibrator()).thenReturn(true);
mDependency.injectTestDependency(NotificationMediaManager.class, mMediaManager);
mBiometricUnlockController = new BiometricUnlockController(mDozeScrimController,
- mKeyguardViewMediator,
+ mKeyguardViewMediator, mScrimController,
mNotificationShadeWindowController, mKeyguardStateController, mHandler,
mUpdateMonitor, res.getResources(), mKeyguardBypassController,
mMetricsLogger, mDumpManager, mPowerManager, mLogger,