DO NOT MERGE Update naming for the AlternateBouncer
Differentiate naming of the AlternateBouncer and
PrimaryBouncer. The AlternateBouncer was formerly
referred to as "AltAuth" and "AlternateAuth method".
Instead, consistently refer to it as the AlternateBouncer.
The AlternateBouncer can be implemented by specific
biometric modalities to encourage users to use a biometric
before the PrimaryBouncer (pin/pattern/password input) shows.
Test: atest SystemUITests
Bug: 237362467
Change-Id: Icd2f8fbf76192d9ce8b5ecad3aa4919f9c3a49c0
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 1bb83f4..47ea878 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -314,8 +314,8 @@
private boolean mCredentialAttempted;
private boolean mKeyguardGoingAway;
private boolean mGoingToSleep;
- private boolean mBouncerFullyShown;
- private boolean mBouncerIsOrWillBeShowing;
+ private boolean mPrimaryBouncerFullyShown;
+ private boolean mPrimaryBouncerIsOrWillBeShowing;
private boolean mUdfpsBouncerShowing;
private boolean mAuthInterruptActive;
private boolean mNeedsSlowUnlockTransition;
@@ -1664,8 +1664,9 @@
public void onAuthenticationFailed() {
String reason =
mKeyguardBypassController.canBypass() ? "bypass"
- : mUdfpsBouncerShowing ? "udfpsBouncer" :
- mBouncerFullyShown ? "bouncer" : "udfpsFpDown";
+ : mUdfpsBouncerShowing ? "udfpsBouncer"
+ : mPrimaryBouncerFullyShown ? "bouncer"
+ : "udfpsFpDown";
requestActiveUnlock(
ActiveUnlockConfig.ACTIVE_UNLOCK_REQUEST_ORIGIN.BIOMETRIC_FAIL,
"faceFailure-" + reason);
@@ -2057,7 +2058,7 @@
handleKeyguardReset();
break;
case MSG_KEYGUARD_BOUNCER_CHANGED:
- handleKeyguardBouncerChanged(msg.arg1, msg.arg2);
+ handlePrimaryBouncerChanged(msg.arg1, msg.arg2);
break;
case MSG_REPORT_EMERGENCY_CALL_ACTION:
handleReportEmergencyCallAction();
@@ -2526,7 +2527,7 @@
requestOrigin,
extraReason, canFaceBypass
|| mUdfpsBouncerShowing
- || mBouncerFullyShown
+ || mPrimaryBouncerFullyShown
|| mAuthController.isUdfpsFingerDown());
}
@@ -2547,7 +2548,7 @@
private boolean shouldTriggerActiveUnlock() {
// Triggers:
final boolean triggerActiveUnlockForAssistant = shouldTriggerActiveUnlockForAssistant();
- final boolean awakeKeyguard = mBouncerFullyShown || mUdfpsBouncerShowing
+ final boolean awakeKeyguard = mPrimaryBouncerFullyShown || mUdfpsBouncerShowing
|| (isKeyguardVisible() && !mGoingToSleep
&& mStatusBarState != StatusBarState.SHADE_LOCKED);
@@ -2626,7 +2627,7 @@
final boolean shouldListenKeyguardState =
isKeyguardVisible()
|| !mDeviceInteractive
- || (mBouncerIsOrWillBeShowing && !mKeyguardGoingAway)
+ || (mPrimaryBouncerIsOrWillBeShowing && !mKeyguardGoingAway)
|| mGoingToSleep
|| shouldListenForFingerprintAssistant
|| (mKeyguardOccluded && mIsDreaming)
@@ -2645,8 +2646,8 @@
&& mIsPrimaryUser
&& biometricEnabledForUser;
- final boolean shouldListenBouncerState =
- !(mFingerprintLockedOut && mBouncerIsOrWillBeShowing && mCredentialAttempted);
+ final boolean shouldListenBouncerState = !(mFingerprintLockedOut
+ && mPrimaryBouncerIsOrWillBeShowing && mCredentialAttempted);
final boolean isEncryptedOrLockdownForUser = isEncryptedOrLockdown(user);
@@ -2671,7 +2672,7 @@
user,
shouldListen,
biometricEnabledForUser,
- mBouncerIsOrWillBeShowing,
+ mPrimaryBouncerIsOrWillBeShowing,
userCanSkipBouncer,
mCredentialAttempted,
mDeviceInteractive,
@@ -2728,7 +2729,7 @@
// Scan even when encrypted or timeout to show a preemptive bouncer when bypassing.
// Lock-down mode shouldn't scan, since it is more explicit.
boolean strongAuthAllowsScanning = (!isEncryptedOrTimedOut || canBypass
- && !mBouncerFullyShown);
+ && !mPrimaryBouncerFullyShown);
// If the device supports face detection (without authentication) and bypass is enabled,
// allow face scanning to happen if the device is in lockdown mode.
@@ -2749,7 +2750,7 @@
// Only listen if this KeyguardUpdateMonitor belongs to the primary user. There is an
// instance of KeyguardUpdateMonitor for each user but KeyguardUpdateMonitor is user-aware.
final boolean shouldListen =
- (mBouncerFullyShown
+ (mPrimaryBouncerFullyShown
|| mAuthInterruptActive
|| mOccludingAppRequestingFace
|| awakeKeyguard
@@ -2776,7 +2777,7 @@
mAuthInterruptActive,
becauseCannotSkipBouncer,
biometricEnabledForUser,
- mBouncerFullyShown,
+ mPrimaryBouncerFullyShown,
faceAuthenticated,
faceDisabledForUser,
isFaceLockedOut(),
@@ -3306,17 +3307,19 @@
/**
* Handle {@link #MSG_KEYGUARD_BOUNCER_CHANGED}
*
- * @see #sendKeyguardBouncerChanged(boolean, boolean)
+ * @see #sendPrimaryBouncerChanged(boolean, boolean)
*/
- private void handleKeyguardBouncerChanged(int bouncerIsOrWillBeShowing, int bouncerFullyShown) {
+ private void handlePrimaryBouncerChanged(int primaryBouncerIsOrWillBeShowing,
+ int primaryBouncerFullyShown) {
Assert.isMainThread();
- final boolean wasBouncerIsOrWillBeShowing = mBouncerIsOrWillBeShowing;
- final boolean wasBouncerFullyShown = mBouncerFullyShown;
- mBouncerIsOrWillBeShowing = bouncerIsOrWillBeShowing == 1;
- mBouncerFullyShown = bouncerFullyShown == 1;
- mLogger.logKeyguardBouncerChanged(mBouncerIsOrWillBeShowing, mBouncerFullyShown);
+ final boolean wasPrimaryBouncerIsOrWillBeShowing = mPrimaryBouncerIsOrWillBeShowing;
+ final boolean wasPrimaryBouncerFullyShown = mPrimaryBouncerFullyShown;
+ mPrimaryBouncerIsOrWillBeShowing = primaryBouncerIsOrWillBeShowing == 1;
+ mPrimaryBouncerFullyShown = primaryBouncerFullyShown == 1;
+ mLogger.logPrimaryKeyguardBouncerChanged(mPrimaryBouncerIsOrWillBeShowing,
+ mPrimaryBouncerFullyShown);
- if (mBouncerFullyShown) {
+ if (mPrimaryBouncerFullyShown) {
// If the bouncer is shown, always clear this flag. This can happen in the following
// situations: 1) Default camera with SHOW_WHEN_LOCKED is not chosen yet. 2) Secure
// camera requests dismiss keyguard (tapping on photos for example). When these happen,
@@ -3326,18 +3329,18 @@
mCredentialAttempted = false;
}
- if (wasBouncerIsOrWillBeShowing != mBouncerIsOrWillBeShowing) {
+ if (wasPrimaryBouncerIsOrWillBeShowing != mPrimaryBouncerIsOrWillBeShowing) {
for (int i = 0; i < mCallbacks.size(); i++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
if (cb != null) {
- cb.onKeyguardBouncerStateChanged(mBouncerIsOrWillBeShowing);
+ cb.onKeyguardBouncerStateChanged(mPrimaryBouncerIsOrWillBeShowing);
}
}
updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE);
}
- if (wasBouncerFullyShown != mBouncerFullyShown) {
- if (mBouncerFullyShown) {
+ if (wasPrimaryBouncerFullyShown != mPrimaryBouncerFullyShown) {
+ if (mPrimaryBouncerFullyShown) {
requestActiveUnlock(
ActiveUnlockConfig.ACTIVE_UNLOCK_REQUEST_ORIGIN.UNLOCK_INTENT,
"bouncerFullyShown");
@@ -3345,7 +3348,7 @@
for (int i = 0; i < mCallbacks.size(); i++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
if (cb != null) {
- cb.onKeyguardBouncerFullyShowingChanged(mBouncerFullyShown);
+ cb.onKeyguardBouncerFullyShowingChanged(mPrimaryBouncerFullyShown);
}
}
updateFaceListeningState(BIOMETRIC_ACTION_UPDATE,
@@ -3496,14 +3499,15 @@
}
/**
- * @see #handleKeyguardBouncerChanged(int, int)
+ * @see #handlePrimaryBouncerChanged(int, int)
*/
- public void sendKeyguardBouncerChanged(boolean bouncerIsOrWillBeShowing,
- boolean bouncerFullyShown) {
- mLogger.logSendKeyguardBouncerChanged(bouncerIsOrWillBeShowing, bouncerFullyShown);
+ public void sendPrimaryBouncerChanged(boolean primaryBouncerIsOrWillBeShowing,
+ boolean primaryBouncerFullyShown) {
+ mLogger.logSendPrimaryBouncerChanged(primaryBouncerIsOrWillBeShowing,
+ primaryBouncerFullyShown);
Message message = mHandler.obtainMessage(MSG_KEYGUARD_BOUNCER_CHANGED);
- message.arg1 = bouncerIsOrWillBeShowing ? 1 : 0;
- message.arg2 = bouncerFullyShown ? 1 : 0;
+ message.arg1 = primaryBouncerIsOrWillBeShowing ? 1 : 0;
+ message.arg2 = primaryBouncerFullyShown ? 1 : 0;
message.sendToTarget();
}
@@ -3863,7 +3867,8 @@
if (isUdfpsSupported()) {
pw.println(" udfpsEnrolled=" + isUdfpsEnrolled());
pw.println(" shouldListenForUdfps=" + shouldListenForFingerprint(true));
- pw.println(" mBouncerIsOrWillBeShowing=" + mBouncerIsOrWillBeShowing);
+ pw.println(" mPrimaryBouncerIsOrWillBeShowing="
+ + mPrimaryBouncerIsOrWillBeShowing);
pw.println(" mStatusBarState=" + StatusBarState.toString(mStatusBarState));
pw.println(" mUdfpsBouncerShowing=" + mUdfpsBouncerShowing);
} else if (isSfpsSupported()) {
@@ -3893,7 +3898,7 @@
pw.println(" mFaceLockedOutPermanent=" + mFaceLockedOutPermanent);
pw.println(" enabledByUser=" + mBiometricEnabledForUser.get(userId));
pw.println(" mSecureCameraLaunched=" + mSecureCameraLaunched);
- pw.println(" mBouncerFullyShown=" + mBouncerFullyShown);
+ pw.println(" mPrimaryBouncerFullyShown=" + mPrimaryBouncerFullyShown);
pw.println(" mNeedsSlowUnlockTransition=" + mNeedsSlowUnlockTransition);
}
mListenModels.print(pw);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java
index 90f0446..6c3c246 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java
@@ -50,16 +50,11 @@
/**
* Resets the state of Keyguard View.
- * @param hideBouncerWhenShowing
+ * @param hideBouncerWhenShowing when true, hides the primary and alternate bouncers if showing.
*/
void reset(boolean hideBouncerWhenShowing);
/**
- * Stop showing any alternate auth methods.
- */
- void resetAlternateAuth(boolean forceUpdateScrim);
-
- /**
* Called when the device started going to sleep.
*/
default void onStartedGoingToSleep() {};
@@ -156,20 +151,24 @@
void notifyKeyguardAuthenticated(boolean strongAuth);
/**
- * Shows the Bouncer.
- *
+ * Shows the primary bouncer.
*/
- void showBouncer(boolean scrimmed);
+ void showPrimaryBouncer(boolean scrimmed);
/**
- * Returns {@code true} when the bouncer is currently showing
+ * When the primary bouncer is fully visible or is showing but animation didn't finish yet.
+ */
+ boolean primaryBouncerIsOrWillBeShowing();
+
+ /**
+ * Returns {@code true} when the primary bouncer or alternate bouncer is currently showing
*/
boolean isBouncerShowing();
/**
- * When bouncer is fully visible or it is showing but animation didn't finish yet.
+ * Stop showing the alternate bouncer, if showing.
*/
- boolean bouncerIsOrWillBeShowing();
+ void hideAlternateBouncer(boolean forceUpdateScrim);
// TODO: Deprecate registerStatusBar in KeyguardViewController interface. It is currently
// only used for testing purposes in StatusBarKeyguardViewManager, and it prevents us from
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index fe7c70a..e41d3d5 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -695,7 +695,7 @@
"lock-screen-lock-icon-longpress",
TOUCH_VIBRATION_ATTRIBUTES);
- mKeyguardViewController.showBouncer(/* scrim */ true);
+ mKeyguardViewController.showPrimaryBouncer(/* scrim */ true);
}
diff --git a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt
index 6276142d..81b8dfe 100644
--- a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt
+++ b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt
@@ -166,13 +166,16 @@
{ "Previously active sub id $int1 is now invalid, will remove" })
}
- fun logKeyguardBouncerChanged(bouncerIsOrWillBeShowing: Boolean, bouncerFullyShown: Boolean) {
+ fun logPrimaryKeyguardBouncerChanged(
+ primaryBouncerIsOrWillBeShowing: Boolean,
+ primaryBouncerFullyShown: Boolean
+ ) {
logBuffer.log(TAG, DEBUG, {
- bool1 = bouncerIsOrWillBeShowing
- bool2 = bouncerFullyShown
+ bool1 = primaryBouncerIsOrWillBeShowing
+ bool2 = primaryBouncerFullyShown
}, {
- "handleKeyguardBouncerChanged " +
- "bouncerIsOrWillBeShowing=$bool1 bouncerFullyShowing=$bool2"
+ "handlePrimaryBouncerChanged " +
+ "primaryBouncerIsOrWillBeShowing=$bool1 primaryBouncerFullyShown=$bool2"
})
}
@@ -229,16 +232,16 @@
{ "Retrying fingerprint attempt: $int1" })
}
- fun logSendKeyguardBouncerChanged(
- bouncerIsOrWillBeShowing: Boolean,
- bouncerFullyShown: Boolean,
+ fun logSendPrimaryBouncerChanged(
+ primaryBouncerIsOrWillBeShowing: Boolean,
+ primaryBouncerFullyShown: Boolean,
) {
logBuffer.log(TAG, DEBUG, {
- bool1 = bouncerIsOrWillBeShowing
- bool2 = bouncerFullyShown
+ bool1 = primaryBouncerIsOrWillBeShowing
+ bool2 = primaryBouncerFullyShown
}, {
- "sendKeyguardBouncerChanged bouncerIsOrWillBeShowing=$bool1 " +
- "bouncerFullyShown=$bool2"
+ "sendPrimaryBouncerChanged primaryBouncerIsOrWillBeShowing=$bool1 " +
+ "primaryBouncerFullyShown=$bool2"
})
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 71711a2..bc10868 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -67,7 +67,7 @@
import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.keyguard.ScreenLifecycle;
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shade.ShadeExpansionStateManager;
@@ -140,7 +140,7 @@
@NonNull private final LatencyTracker mLatencyTracker;
@VisibleForTesting @NonNull final BiometricDisplayListener mOrientationListener;
@NonNull private final ActivityLaunchAnimator mActivityLaunchAnimator;
- @NonNull private final BouncerInteractor mBouncerInteractor;
+ @NonNull private final PrimaryBouncerInteractor mPrimaryBouncerInteractor;
// Currently the UdfpsController supports a single UDFPS sensor. If devices have multiple
// sensors, this, in addition to a lot of the code here, will be updated.
@@ -229,7 +229,7 @@
mUdfpsDisplayMode, requestId, reason, callback,
(view, event, fromUdfpsView) -> onTouch(requestId, event,
fromUdfpsView), mActivityLaunchAnimator, mFeatureFlags,
- mBouncerInteractor)));
+ mPrimaryBouncerInteractor)));
}
@Override
@@ -320,14 +320,14 @@
if (!mOverlayParams.equals(overlayParams)) {
mOverlayParams = overlayParams;
- final boolean wasShowingAltAuth = mKeyguardViewManager.isShowingAlternateAuth();
+ final boolean wasShowingAltAuth = mKeyguardViewManager.isShowingAlternateBouncer();
// When the bounds change it's always necessary to re-create the overlay's window with
// new LayoutParams. If the overlay needs to be shown, this will re-create and show the
// overlay with the updated LayoutParams. Otherwise, the overlay will remain hidden.
redrawOverlay();
if (wasShowingAltAuth) {
- mKeyguardViewManager.showGenericBouncer(true);
+ mKeyguardViewManager.showBouncer(true);
}
}
}
@@ -626,7 +626,7 @@
@NonNull ActivityLaunchAnimator activityLaunchAnimator,
@NonNull Optional<AlternateUdfpsTouchProvider> alternateTouchProvider,
@NonNull @BiometricsBackground Executor biometricsExecutor,
- @NonNull BouncerInteractor bouncerInteractor) {
+ @NonNull PrimaryBouncerInteractor primaryBouncerInteractor) {
mContext = context;
mExecution = execution;
mVibrator = vibrator;
@@ -643,6 +643,7 @@
mDumpManager = dumpManager;
mDialogManager = dialogManager;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
+ mFeatureFlags = featureFlags;
mFalsingManager = falsingManager;
mPowerManager = powerManager;
mAccessibilityManager = accessibilityManager;
@@ -664,8 +665,7 @@
false /* resetLockoutRequiresHardwareAuthToken */);
mBiometricExecutor = biometricsExecutor;
- mFeatureFlags = featureFlags;
- mBouncerInteractor = bouncerInteractor;
+ mPrimaryBouncerInteractor = primaryBouncerInteractor;
mDumpManager.registerDumpable(TAG, this);
@@ -757,8 +757,8 @@
onFingerUp(mOverlay.getRequestId(), oldView);
}
final boolean removed = mOverlay.hide();
- if (mKeyguardViewManager.isShowingAlternateAuth()) {
- mKeyguardViewManager.resetAlternateAuth(true);
+ if (mKeyguardViewManager.isShowingAlternateBouncer()) {
+ mKeyguardViewManager.hideAlternateBouncer(true);
}
Log.v(TAG, "hideUdfpsOverlay | removing window: " + removed);
} else {
@@ -798,7 +798,7 @@
Log.v(TAG, "aod lock icon long-press rejected by the falsing manager.");
return;
}
- mKeyguardViewManager.showBouncer(true);
+ mKeyguardViewManager.showPrimaryBouncer(true);
// play the same haptic as the LockIconViewController longpress
mVibrator.vibrate(
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
index d70861a..0bb24f8 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
@@ -49,7 +49,7 @@
import com.android.systemui.animation.ActivityLaunchAnimator
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeExpansionStateManager
import com.android.systemui.statusbar.LockscreenShadeTransitionController
@@ -95,7 +95,7 @@
private val onTouch: (View, MotionEvent, Boolean) -> Boolean,
private val activityLaunchAnimator: ActivityLaunchAnimator,
private val featureFlags: FeatureFlags,
- private val bouncerInteractor: BouncerInteractor,
+ private val primaryBouncerInteractor: PrimaryBouncerInteractor,
private val isDebuggable: Boolean = Build.IS_DEBUGGABLE
) {
/** The view, when [isShowing], or null. */
@@ -252,7 +252,7 @@
controller,
activityLaunchAnimator,
featureFlags,
- bouncerInteractor
+ primaryBouncerInteractor
)
}
REASON_AUTH_BP -> {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt
index 5bae2dc..91967f9 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt
@@ -31,7 +31,7 @@
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeExpansionListener
@@ -40,9 +40,9 @@
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
import com.android.systemui.statusbar.phone.KeyguardBouncer
-import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback
+import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
-import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.AlternateAuthInterceptor
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.AlternateBouncer
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.KeyguardViewManagerCallback
import com.android.systemui.statusbar.phone.SystemUIDialogManager
import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController
@@ -73,7 +73,7 @@
private val udfpsController: UdfpsController,
private val activityLaunchAnimator: ActivityLaunchAnimator,
featureFlags: FeatureFlags,
- private val bouncerInteractor: BouncerInteractor
+ private val primaryBouncerInteractor: PrimaryBouncerInteractor
) :
UdfpsAnimationViewController<UdfpsKeyguardView>(
view,
@@ -146,8 +146,8 @@
}
}
- private val bouncerExpansionCallback: BouncerExpansionCallback =
- object : BouncerExpansionCallback {
+ private val mPrimaryBouncerExpansionCallback: PrimaryBouncerExpansionCallback =
+ object : PrimaryBouncerExpansionCallback {
override fun onExpansionChanged(expansion: Float) {
inputBouncerHiddenAmount = expansion
updateAlpha()
@@ -180,7 +180,7 @@
private val shadeExpansionListener = ShadeExpansionListener { (fraction) ->
panelExpansionFraction =
- if (keyguardViewManager.isBouncerInTransit) {
+ if (keyguardViewManager.isPrimaryBouncerInTransit) {
aboutToShowBouncerProgress(fraction)
} else {
fraction
@@ -237,17 +237,17 @@
}
}
- private val alternateAuthInterceptor: AlternateAuthInterceptor =
- object : AlternateAuthInterceptor {
- override fun showAlternateAuthBouncer(): Boolean {
+ private val mAlternateBouncer: AlternateBouncer =
+ object : AlternateBouncer {
+ override fun showAlternateBouncer(): Boolean {
return showUdfpsBouncer(true)
}
- override fun hideAlternateAuthBouncer(): Boolean {
+ override fun hideAlternateBouncer(): Boolean {
return showUdfpsBouncer(false)
}
- override fun isShowingAlternateAuthBouncer(): Boolean {
+ override fun isShowingAlternateBouncer(): Boolean {
return showingUdfpsBouncer
}
@@ -268,7 +268,7 @@
override fun onInit() {
super.onInit()
- keyguardViewManager.setAlternateAuthInterceptor(alternateAuthInterceptor)
+ keyguardViewManager.setAlternateBouncer(mAlternateBouncer)
}
init {
@@ -285,7 +285,7 @@
@VisibleForTesting
internal suspend fun listenForBouncerExpansion(scope: CoroutineScope): Job {
return scope.launch {
- bouncerInteractor.bouncerExpansion.collect { bouncerExpansion: Float ->
+ primaryBouncerInteractor.bouncerExpansion.collect { bouncerExpansion: Float ->
inputBouncerExpansion = bouncerExpansion
updateAlpha()
updatePauseAuth()
@@ -306,10 +306,10 @@
qsExpansion = keyguardViewManager.qsExpansion
keyguardViewManager.addCallback(statusBarKeyguardViewManagerCallback)
if (!isModernBouncerEnabled) {
- val bouncer = keyguardViewManager.bouncer
+ val bouncer = keyguardViewManager.primaryBouncer
bouncer?.expansion?.let {
- bouncerExpansionCallback.onExpansionChanged(it)
- bouncer.addBouncerExpansionCallback(bouncerExpansionCallback)
+ mPrimaryBouncerExpansionCallback.onExpansionChanged(it)
+ bouncer.addBouncerExpansionCallback(mPrimaryBouncerExpansionCallback)
}
updateBouncerHiddenAmount()
}
@@ -319,7 +319,7 @@
view.updatePadding()
updateAlpha()
updatePauseAuth()
- keyguardViewManager.setAlternateAuthInterceptor(alternateAuthInterceptor)
+ keyguardViewManager.setAlternateBouncer(mAlternateBouncer)
lockScreenShadeTransitionController.udfpsKeyguardViewController = this
activityLaunchAnimator.addListener(activityLaunchAnimatorListener)
}
@@ -329,7 +329,7 @@
faceDetectRunning = false
keyguardStateController.removeCallback(keyguardStateControllerCallback)
statusBarStateController.removeCallback(stateListener)
- keyguardViewManager.removeAlternateAuthInterceptor(alternateAuthInterceptor)
+ keyguardViewManager.removeAlternateAuthInterceptor(mAlternateBouncer)
keyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false)
configurationController.removeCallback(configurationListener)
shadeExpansionStateManager.removeExpansionListener(shadeExpansionListener)
@@ -339,7 +339,9 @@
activityLaunchAnimator.removeListener(activityLaunchAnimatorListener)
keyguardViewManager.removeCallback(statusBarKeyguardViewManagerCallback)
if (!isModernBouncerEnabled) {
- keyguardViewManager.bouncer?.removeBouncerExpansionCallback(bouncerExpansionCallback)
+ keyguardViewManager.primaryBouncer?.removeBouncerExpansionCallback(
+ mPrimaryBouncerExpansionCallback
+ )
}
}
@@ -442,7 +444,7 @@
return if (isModernBouncerEnabled) {
inputBouncerExpansion == 1f
} else {
- keyguardViewManager.isBouncerShowing && !keyguardViewManager.isShowingAlternateAuth
+ keyguardViewManager.isBouncerShowing && !keyguardViewManager.isShowingAlternateBouncer
}
}
@@ -462,7 +464,7 @@
*/
private fun maybeShowInputBouncer() {
if (showingUdfpsBouncer && hasUdfpsBouncerShownWithMinTime()) {
- keyguardViewManager.showBouncer(true)
+ keyguardViewManager.showPrimaryBouncer(true)
}
}
@@ -535,8 +537,8 @@
if (isModernBouncerEnabled) {
return
}
- val altBouncerShowing = keyguardViewManager.isShowingAlternateAuth
- if (altBouncerShowing || !keyguardViewManager.bouncerIsOrWillBeShowing()) {
+ val altBouncerShowing = keyguardViewManager.isShowingAlternateBouncer
+ if (altBouncerShowing || !keyguardViewManager.primaryBouncerIsOrWillBeShowing()) {
inputBouncerHiddenAmount = 1f
} else if (keyguardViewManager.isBouncerShowing) {
// input bouncer is fully showing
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayContainerViewController.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayContainerViewController.java
index d0d0184..5c6d248 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayContainerViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayContainerViewController.java
@@ -35,7 +35,7 @@
import com.android.systemui.dreams.complication.ComplicationHostViewController;
import com.android.systemui.dreams.dagger.DreamOverlayComponent;
import com.android.systemui.dreams.dagger.DreamOverlayModule;
-import com.android.systemui.keyguard.domain.interactor.BouncerCallbackInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInteractor;
import com.android.systemui.statusbar.BlurUtils;
import com.android.systemui.statusbar.phone.KeyguardBouncer;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
@@ -76,14 +76,14 @@
// Main thread handler used to schedule periodic tasks (e.g. burn-in protection updates).
private final Handler mHandler;
private final int mDreamOverlayMaxTranslationY;
- private final BouncerCallbackInteractor mBouncerCallbackInteractor;
+ private final PrimaryBouncerCallbackInteractor mPrimaryBouncerCallbackInteractor;
private long mJitterStartTimeMillis;
private boolean mBouncerAnimating;
- private final KeyguardBouncer.BouncerExpansionCallback mBouncerExpansionCallback =
- new KeyguardBouncer.BouncerExpansionCallback() {
+ private final KeyguardBouncer.PrimaryBouncerExpansionCallback mBouncerExpansionCallback =
+ new KeyguardBouncer.PrimaryBouncerExpansionCallback() {
@Override
public void onStartingToShow() {
@@ -136,7 +136,7 @@
@Named(DreamOverlayModule.BURN_IN_PROTECTION_UPDATE_INTERVAL) long
burnInProtectionUpdateInterval,
@Named(DreamOverlayModule.MILLIS_UNTIL_FULL_JITTER) long millisUntilFullJitter,
- BouncerCallbackInteractor bouncerCallbackInteractor,
+ PrimaryBouncerCallbackInteractor primaryBouncerCallbackInteractor,
DreamOverlayAnimationsController animationsController,
DreamOverlayStateController stateController) {
super(containerView);
@@ -160,7 +160,7 @@
mMaxBurnInOffset = maxBurnInOffset;
mBurnInProtectionUpdateInterval = burnInProtectionUpdateInterval;
mMillisUntilFullJitter = millisUntilFullJitter;
- mBouncerCallbackInteractor = bouncerCallbackInteractor;
+ mPrimaryBouncerCallbackInteractor = primaryBouncerCallbackInteractor;
}
@Override
@@ -173,11 +173,11 @@
protected void onViewAttached() {
mJitterStartTimeMillis = System.currentTimeMillis();
mHandler.postDelayed(this::updateBurnInOffsets, mBurnInProtectionUpdateInterval);
- final KeyguardBouncer bouncer = mStatusBarKeyguardViewManager.getBouncer();
+ final KeyguardBouncer bouncer = mStatusBarKeyguardViewManager.getPrimaryBouncer();
if (bouncer != null) {
bouncer.addBouncerExpansionCallback(mBouncerExpansionCallback);
}
- mBouncerCallbackInteractor.addBouncerExpansionCallback(mBouncerExpansionCallback);
+ mPrimaryBouncerCallbackInteractor.addBouncerExpansionCallback(mBouncerExpansionCallback);
// Start dream entry animations. Skip animations for low light clock.
if (!mStateController.isLowLightActive()) {
@@ -188,11 +188,11 @@
@Override
protected void onViewDetached() {
mHandler.removeCallbacks(this::updateBurnInOffsets);
- final KeyguardBouncer bouncer = mStatusBarKeyguardViewManager.getBouncer();
+ final KeyguardBouncer bouncer = mStatusBarKeyguardViewManager.getPrimaryBouncer();
if (bouncer != null) {
bouncer.removeBouncerExpansionCallback(mBouncerExpansionCallback);
}
- mBouncerCallbackInteractor.removeBouncerExpansionCallback(mBouncerExpansionCallback);
+ mPrimaryBouncerCallbackInteractor.removeBouncerExpansionCallback(mBouncerExpansionCallback);
mDreamOverlayAnimationsController.cancelRunningEntryAnimations();
}
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java b/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java
index 0dba4ff..92cdcf9 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java
@@ -116,7 +116,7 @@
if (mCapture) {
// Since the user is dragging the bouncer up, set scrimmed to false.
- mStatusBarKeyguardViewManager.showBouncer(false);
+ mStatusBarKeyguardViewManager.showPrimaryBouncer(false);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt
index 0046256..d4514c5 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt
@@ -28,7 +28,7 @@
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
-/** Encapsulates app state for the lock screen bouncer. */
+/** Encapsulates app state for the lock screen primary and alternate bouncer. */
@SysUISingleton
class KeyguardBouncerRepository
@Inject
@@ -36,12 +36,24 @@
private val viewMediatorCallback: ViewMediatorCallback,
keyguardUpdateMonitor: KeyguardUpdateMonitor,
) {
- var bouncerPromptReason: Int? = null
- /** Determines if we want to instantaneously show the bouncer instead of translating. */
- private val _isScrimmed = MutableStateFlow(false)
- val isScrimmed = _isScrimmed.asStateFlow()
+ /** Values associated with the PrimaryBouncer (pin/pattern/password) input. */
+ private val _primaryBouncerVisible = MutableStateFlow(false)
+ val primaryBouncerVisible = _primaryBouncerVisible.asStateFlow()
+ private val _primaryBouncerShow = MutableStateFlow<KeyguardBouncerModel?>(null)
+ val primaryBouncerShow = _primaryBouncerShow.asStateFlow()
+ private val _primaryBouncerShowingSoon = MutableStateFlow(false)
+ val primaryBouncerShowingSoon = _primaryBouncerShowingSoon.asStateFlow()
+ private val _primaryBouncerHide = MutableStateFlow(false)
+ val primaryBouncerHide = _primaryBouncerHide.asStateFlow()
+ private val _primaryBouncerStartingToHide = MutableStateFlow(false)
+ val primaryBouncerStartingToHide = _primaryBouncerStartingToHide.asStateFlow()
+ private val _primaryBouncerDisappearAnimation = MutableStateFlow<Runnable?>(null)
+ val primaryBouncerStartingDisappearAnimation = _primaryBouncerDisappearAnimation.asStateFlow()
+ /** Determines if we want to instantaneously show the primary bouncer instead of translating. */
+ private val _primaryBouncerScrimmed = MutableStateFlow(false)
+ val primaryBouncerScrimmed = _primaryBouncerScrimmed.asStateFlow()
/**
- * Set how much of the panel is showing on the screen.
+ * Set how much of the notification panel is showing on the screen.
* ```
* 0f = panel fully hidden = bouncer fully showing
* 1f = panel fully showing = bouncer fully hidden
@@ -49,31 +61,21 @@
*/
private val _panelExpansionAmount = MutableStateFlow(KeyguardBouncer.EXPANSION_HIDDEN)
val panelExpansionAmount = _panelExpansionAmount.asStateFlow()
- private val _isVisible = MutableStateFlow(false)
- val isVisible = _isVisible.asStateFlow()
- private val _show = MutableStateFlow<KeyguardBouncerModel?>(null)
- val show = _show.asStateFlow()
- private val _showingSoon = MutableStateFlow(false)
- val showingSoon = _showingSoon.asStateFlow()
- private val _hide = MutableStateFlow(false)
- val hide = _hide.asStateFlow()
- private val _startingToHide = MutableStateFlow(false)
- val startingToHide = _startingToHide.asStateFlow()
- private val _disappearAnimation = MutableStateFlow<Runnable?>(null)
- val startingDisappearAnimation = _disappearAnimation.asStateFlow()
private val _keyguardPosition = MutableStateFlow(0f)
val keyguardPosition = _keyguardPosition.asStateFlow()
- private val _resourceUpdateRequests = MutableStateFlow(false)
- val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow()
- private val _showMessage = MutableStateFlow<BouncerShowMessageModel?>(null)
- val showMessage = _showMessage.asStateFlow()
+ private val _onScreenTurnedOff = MutableStateFlow(false)
+ val onScreenTurnedOff = _onScreenTurnedOff.asStateFlow()
+ private val _isBackButtonEnabled = MutableStateFlow<Boolean?>(null)
+ val isBackButtonEnabled = _isBackButtonEnabled.asStateFlow()
private val _keyguardAuthenticated = MutableStateFlow<Boolean?>(null)
/** Determines if user is already unlocked */
val keyguardAuthenticated = _keyguardAuthenticated.asStateFlow()
- private val _isBackButtonEnabled = MutableStateFlow<Boolean?>(null)
- val isBackButtonEnabled = _isBackButtonEnabled.asStateFlow()
- private val _onScreenTurnedOff = MutableStateFlow(false)
- val onScreenTurnedOff = _onScreenTurnedOff.asStateFlow()
+
+ var bouncerPromptReason: Int? = null
+ private val _showMessage = MutableStateFlow<BouncerShowMessageModel?>(null)
+ val showMessage = _showMessage.asStateFlow()
+ private val _resourceUpdateRequests = MutableStateFlow(false)
+ val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow()
val bouncerErrorMessage: CharSequence?
get() = viewMediatorCallback.consumeCustomMessage()
@@ -95,38 +97,38 @@
keyguardUpdateMonitor.registerCallback(callback)
}
- fun setScrimmed(isScrimmed: Boolean) {
- _isScrimmed.value = isScrimmed
+ fun setPrimaryScrimmed(isScrimmed: Boolean) {
+ _primaryBouncerScrimmed.value = isScrimmed
+ }
+
+ fun setPrimaryVisible(isVisible: Boolean) {
+ _primaryBouncerVisible.value = isVisible
+ }
+
+ fun setPrimaryShow(keyguardBouncerModel: KeyguardBouncerModel?) {
+ _primaryBouncerShow.value = keyguardBouncerModel
+ }
+
+ fun setPrimaryShowingSoon(showingSoon: Boolean) {
+ _primaryBouncerShowingSoon.value = showingSoon
+ }
+
+ fun setPrimaryHide(hide: Boolean) {
+ _primaryBouncerHide.value = hide
+ }
+
+ fun setPrimaryStartingToHide(startingToHide: Boolean) {
+ _primaryBouncerStartingToHide.value = startingToHide
+ }
+
+ fun setPrimaryStartDisappearAnimation(runnable: Runnable?) {
+ _primaryBouncerDisappearAnimation.value = runnable
}
fun setPanelExpansion(panelExpansion: Float) {
_panelExpansionAmount.value = panelExpansion
}
- fun setVisible(isVisible: Boolean) {
- _isVisible.value = isVisible
- }
-
- fun setShow(keyguardBouncerModel: KeyguardBouncerModel?) {
- _show.value = keyguardBouncerModel
- }
-
- fun setShowingSoon(showingSoon: Boolean) {
- _showingSoon.value = showingSoon
- }
-
- fun setHide(hide: Boolean) {
- _hide.value = hide
- }
-
- fun setStartingToHide(startingToHide: Boolean) {
- _startingToHide.value = startingToHide
- }
-
- fun setStartDisappearAnimation(runnable: Runnable?) {
- _disappearAnimation.value = runnable
- }
-
fun setKeyguardPosition(keyguardPosition: Float) {
_keyguardPosition.value = keyguardPosition
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/BouncerCallbackInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerCallbackInteractor.kt
similarity index 91%
rename from packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/BouncerCallbackInteractor.kt
rename to packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerCallbackInteractor.kt
index 10c7a37..c5e49c6 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/BouncerCallbackInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerCallbackInteractor.kt
@@ -24,9 +24,9 @@
/** Interactor to add and remove callbacks for the bouncer. */
@SysUISingleton
-class BouncerCallbackInteractor @Inject constructor() {
+class PrimaryBouncerCallbackInteractor @Inject constructor() {
private var resetCallbacks = ListenerSet<KeyguardBouncer.KeyguardResetCallback>()
- private var expansionCallbacks = ArrayList<KeyguardBouncer.BouncerExpansionCallback>()
+ private var expansionCallbacks = ArrayList<KeyguardBouncer.PrimaryBouncerExpansionCallback>()
/** Add a KeyguardResetCallback. */
fun addKeyguardResetCallback(callback: KeyguardBouncer.KeyguardResetCallback) {
resetCallbacks.addIfAbsent(callback)
@@ -38,7 +38,7 @@
}
/** Adds a callback to listen to bouncer expansion updates. */
- fun addBouncerExpansionCallback(callback: KeyguardBouncer.BouncerExpansionCallback) {
+ fun addBouncerExpansionCallback(callback: KeyguardBouncer.PrimaryBouncerExpansionCallback) {
if (!expansionCallbacks.contains(callback)) {
expansionCallbacks.add(callback)
}
@@ -48,7 +48,7 @@
* Removes a previously added callback. If the callback was never added, this method does
* nothing.
*/
- fun removeBouncerExpansionCallback(callback: KeyguardBouncer.BouncerExpansionCallback) {
+ fun removeBouncerExpansionCallback(callback: KeyguardBouncer.PrimaryBouncerExpansionCallback) {
expansionCallbacks.remove(callback)
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/BouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
similarity index 76%
rename from packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/BouncerInteractor.kt
rename to packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
index dbb0352..c22f4e7a 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/BouncerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt
@@ -44,24 +44,27 @@
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.map
-/** Encapsulates business logic for interacting with the lock-screen bouncer. */
+/**
+ * Encapsulates business logic for interacting with the lock-screen primary (pin/pattern/password)
+ * bouncer.
+ */
@SysUISingleton
-class BouncerInteractor
+class PrimaryBouncerInteractor
@Inject
constructor(
private val repository: KeyguardBouncerRepository,
- private val bouncerView: BouncerView,
+ private val primaryBouncerView: BouncerView,
@Main private val mainHandler: Handler,
private val keyguardStateController: KeyguardStateController,
private val keyguardSecurityModel: KeyguardSecurityModel,
- private val callbackInteractor: BouncerCallbackInteractor,
+ private val primaryBouncerCallbackInteractor: PrimaryBouncerCallbackInteractor,
private val falsingCollector: FalsingCollector,
private val dismissCallbackRegistry: DismissCallbackRegistry,
keyguardBypassController: KeyguardBypassController,
keyguardUpdateMonitor: KeyguardUpdateMonitor,
) {
/** Whether we want to wait for face auth. */
- private val bouncerFaceDelay =
+ private val primaryBouncerFaceDelay =
keyguardStateController.isFaceAuthEnabled &&
!keyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
KeyguardUpdateMonitor.getCurrentUser()
@@ -70,38 +73,39 @@
!keyguardUpdateMonitor.userNeedsStrongAuth() &&
!keyguardBypassController.bypassEnabled
- /** Runnable to show the bouncer. */
+ /** Runnable to show the primary bouncer. */
val showRunnable = Runnable {
- repository.setVisible(true)
- repository.setShow(
+ repository.setPrimaryVisible(true)
+ repository.setPrimaryShow(
KeyguardBouncerModel(
promptReason = repository.bouncerPromptReason ?: 0,
errorMessage = repository.bouncerErrorMessage,
expansionAmount = repository.panelExpansionAmount.value
)
)
- repository.setShowingSoon(false)
+ repository.setPrimaryShowingSoon(false)
}
val keyguardAuthenticated: Flow<Boolean> = repository.keyguardAuthenticated.filterNotNull()
val screenTurnedOff: Flow<Unit> = repository.onScreenTurnedOff.filter { it }.map {}
- val show: Flow<KeyguardBouncerModel> = repository.show.filterNotNull()
- val hide: Flow<Unit> = repository.hide.filter { it }.map {}
- val startingToHide: Flow<Unit> = repository.startingToHide.filter { it }.map {}
- val isVisible: Flow<Boolean> = repository.isVisible
+ val show: Flow<KeyguardBouncerModel> = repository.primaryBouncerShow.filterNotNull()
+ val hide: Flow<Unit> = repository.primaryBouncerHide.filter { it }.map {}
+ val startingToHide: Flow<Unit> = repository.primaryBouncerStartingToHide.filter { it }.map {}
+ val isVisible: Flow<Boolean> = repository.primaryBouncerVisible
val isBackButtonEnabled: Flow<Boolean> = repository.isBackButtonEnabled.filterNotNull()
val showMessage: Flow<BouncerShowMessageModel> = repository.showMessage.filterNotNull()
val startingDisappearAnimation: Flow<Runnable> =
- repository.startingDisappearAnimation.filterNotNull()
+ repository.primaryBouncerStartingDisappearAnimation.filterNotNull()
val resourceUpdateRequests: Flow<Boolean> = repository.resourceUpdateRequests.filter { it }
val keyguardPosition: Flow<Float> = repository.keyguardPosition
val panelExpansionAmount: Flow<Float> = repository.panelExpansionAmount
/** 0f = bouncer fully hidden. 1f = bouncer fully visible. */
- val bouncerExpansion: Flow<Float> = //
- combine(repository.panelExpansionAmount, repository.isVisible) { expansionAmount, isVisible
- ->
- if (isVisible) {
- 1f - expansionAmount
+ val bouncerExpansion: Flow<Float> =
+ combine(repository.panelExpansionAmount, repository.primaryBouncerVisible) {
+ panelExpansion,
+ primaryBouncerVisible ->
+ if (primaryBouncerVisible) {
+ 1f - panelExpansion
} else {
0f
}
@@ -116,13 +120,14 @@
repository.setShowMessage(null)
repository.setOnScreenTurnedOff(false)
repository.setKeyguardAuthenticated(null)
- repository.setHide(false)
- repository.setStartingToHide(false)
+ repository.setPrimaryHide(false)
+ repository.setPrimaryStartingToHide(false)
val resumeBouncer =
- (repository.isVisible.value || repository.showingSoon.value) && needsFullscreenBouncer()
+ (repository.primaryBouncerVisible.value ||
+ repository.primaryBouncerShowingSoon.value) && needsFullscreenBouncer()
- if (!resumeBouncer && repository.show.value != null) {
+ if (!resumeBouncer && repository.primaryBouncerShow.value != null) {
// If bouncer is visible, the bouncer is already showing.
return
}
@@ -134,29 +139,29 @@
}
Trace.beginSection("KeyguardBouncer#show")
- repository.setScrimmed(isScrimmed)
+ repository.setPrimaryScrimmed(isScrimmed)
if (isScrimmed) {
setPanelExpansion(KeyguardBouncer.EXPANSION_VISIBLE)
}
if (resumeBouncer) {
- bouncerView.delegate?.resume()
+ primaryBouncerView.delegate?.resume()
// Bouncer is showing the next security screen and we just need to prompt a resume.
return
}
- if (bouncerView.delegate?.showNextSecurityScreenOrFinish() == true) {
+ if (primaryBouncerView.delegate?.showNextSecurityScreenOrFinish() == true) {
// Keyguard is done.
return
}
- repository.setShowingSoon(true)
- if (bouncerFaceDelay) {
+ repository.setPrimaryShowingSoon(true)
+ if (primaryBouncerFaceDelay) {
mainHandler.postDelayed(showRunnable, 1200L)
} else {
DejankUtils.postAfterTraversal(showRunnable)
}
keyguardStateController.notifyBouncerShowing(true)
- callbackInteractor.dispatchStartingToShow()
+ primaryBouncerCallbackInteractor.dispatchStartingToShow()
Trace.endSection()
}
@@ -174,10 +179,10 @@
falsingCollector.onBouncerHidden()
keyguardStateController.notifyBouncerShowing(false /* showing */)
cancelShowRunnable()
- repository.setShowingSoon(false)
- repository.setVisible(false)
- repository.setHide(true)
- repository.setShow(null)
+ repository.setPrimaryShowingSoon(false)
+ repository.setPrimaryVisible(false)
+ repository.setPrimaryHide(true)
+ repository.setPrimaryShow(null)
Trace.endSection()
}
@@ -191,7 +196,7 @@
fun setPanelExpansion(expansion: Float) {
val oldExpansion = repository.panelExpansionAmount.value
val expansionChanged = oldExpansion != expansion
- if (repository.startingDisappearAnimation.value == null) {
+ if (repository.primaryBouncerStartingDisappearAnimation.value == null) {
repository.setPanelExpansion(expansion)
}
@@ -200,25 +205,25 @@
oldExpansion != KeyguardBouncer.EXPANSION_VISIBLE
) {
falsingCollector.onBouncerShown()
- callbackInteractor.dispatchFullyShown()
+ primaryBouncerCallbackInteractor.dispatchFullyShown()
} else if (
expansion == KeyguardBouncer.EXPANSION_HIDDEN &&
oldExpansion != KeyguardBouncer.EXPANSION_HIDDEN
) {
- repository.setVisible(false)
- repository.setShow(null)
+ repository.setPrimaryVisible(false)
+ repository.setPrimaryShow(null)
falsingCollector.onBouncerHidden()
- DejankUtils.postAfterTraversal { callbackInteractor.dispatchReset() }
- callbackInteractor.dispatchFullyHidden()
+ DejankUtils.postAfterTraversal { primaryBouncerCallbackInteractor.dispatchReset() }
+ primaryBouncerCallbackInteractor.dispatchFullyHidden()
} else if (
expansion != KeyguardBouncer.EXPANSION_VISIBLE &&
oldExpansion == KeyguardBouncer.EXPANSION_VISIBLE
) {
- callbackInteractor.dispatchStartingToHide()
- repository.setStartingToHide(true)
+ primaryBouncerCallbackInteractor.dispatchStartingToHide()
+ repository.setPrimaryStartingToHide(true)
}
if (expansionChanged) {
- callbackInteractor.dispatchExpansionChanged(expansion)
+ primaryBouncerCallbackInteractor.dispatchExpansionChanged(expansion)
}
}
@@ -236,7 +241,7 @@
onDismissAction: ActivityStarter.OnDismissAction?,
cancelAction: Runnable?
) {
- bouncerView.delegate?.setDismissAction(onDismissAction, cancelAction)
+ primaryBouncerView.delegate?.setDismissAction(onDismissAction, cancelAction)
}
/** Update the resources of the views. */
@@ -266,7 +271,7 @@
/** Notify that view visibility has changed. */
fun notifyBouncerVisibilityHasChanged(visibility: Int) {
- callbackInteractor.dispatchVisibilityChanged(visibility)
+ primaryBouncerCallbackInteractor.dispatchVisibilityChanged(visibility)
}
/** Notify that the resources have been updated */
@@ -283,38 +288,39 @@
fun startDisappearAnimation(runnable: Runnable) {
val finishRunnable = Runnable {
runnable.run()
- repository.setStartDisappearAnimation(null)
+ repository.setPrimaryStartDisappearAnimation(null)
}
- repository.setStartDisappearAnimation(finishRunnable)
+ repository.setPrimaryStartDisappearAnimation(finishRunnable)
}
/** Returns whether bouncer is fully showing. */
fun isFullyShowing(): Boolean {
- return (repository.showingSoon.value || repository.isVisible.value) &&
+ return (repository.primaryBouncerShowingSoon.value ||
+ repository.primaryBouncerVisible.value) &&
repository.panelExpansionAmount.value == KeyguardBouncer.EXPANSION_VISIBLE &&
- repository.startingDisappearAnimation.value == null
+ repository.primaryBouncerStartingDisappearAnimation.value == null
}
/** Returns whether bouncer is scrimmed. */
fun isScrimmed(): Boolean {
- return repository.isScrimmed.value
+ return repository.primaryBouncerScrimmed.value
}
/** If bouncer expansion is between 0f and 1f non-inclusive. */
fun isInTransit(): Boolean {
- return repository.showingSoon.value ||
+ return repository.primaryBouncerShowingSoon.value ||
repository.panelExpansionAmount.value != KeyguardBouncer.EXPANSION_HIDDEN &&
repository.panelExpansionAmount.value != KeyguardBouncer.EXPANSION_VISIBLE
}
/** Return whether bouncer is animating away. */
fun isAnimatingAway(): Boolean {
- return repository.startingDisappearAnimation.value != null
+ return repository.primaryBouncerStartingDisappearAnimation.value != null
}
/** Return whether bouncer will dismiss with actions */
fun willDismissWithAction(): Boolean {
- return bouncerView.delegate?.willDismissWithActions() == true
+ return primaryBouncerView.delegate?.willDismissWithActions() == true
}
/** Returns whether the bouncer should be full screen. */
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt
index 9a92843..0781600 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt
@@ -19,7 +19,7 @@
import android.view.View
import com.android.systemui.keyguard.data.BouncerView
import com.android.systemui.keyguard.data.BouncerViewDelegate
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel
import com.android.systemui.keyguard.shared.model.KeyguardBouncerModel
import com.android.systemui.statusbar.phone.KeyguardBouncer.EXPANSION_VISIBLE
@@ -34,7 +34,7 @@
@Inject
constructor(
private val view: BouncerView,
- private val interactor: BouncerInteractor,
+ private val interactor: PrimaryBouncerInteractor,
) {
/** Observe on bouncer expansion amount. */
val bouncerExpansionAmount: Flow<Float> = interactor.panelExpansionAmount
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
index abc0ade..64962b4 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
@@ -237,7 +237,7 @@
* @return if bouncer is in transit
*/
public boolean isBouncerInTransit() {
- return mStatusBarKeyguardViewManager.isBouncerInTransit();
+ return mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index b8c4b3e..21f6218 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -4657,7 +4657,7 @@
mUpdateFlingVelocity = vel;
}
} else if (!mCentralSurfaces.isBouncerShowing()
- && !mStatusBarKeyguardViewManager.isShowingAlternateAuth()
+ && !mStatusBarKeyguardViewManager.isShowingAlternateBouncer()
&& !mKeyguardStateController.isKeyguardGoingAway()) {
onEmptySpaceClick();
onTrackingStopped(true);
@@ -6041,7 +6041,7 @@
== AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD.getId()
|| action
== AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP.getId()) {
- mStatusBarKeyguardViewManager.showBouncer(true);
+ mStatusBarKeyguardViewManager.showPrimaryBouncer(true);
return true;
}
return super.performAccessibilityAction(host, action, args);
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
index 1e63b2d..bb67280c 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
@@ -284,7 +284,7 @@
return true;
}
- if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
+ if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
// capture all touches if the alt auth bouncer is showing
return true;
}
@@ -322,7 +322,7 @@
handled = !mService.isPulsing();
}
- if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
+ if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
// eat the touch
handled = true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index f2b8603..3670d09 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -925,7 +925,7 @@
}
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
- if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
+ if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
return; // udfps affordance is highlighted, no need to show action to unlock
} else if (mKeyguardUpdateMonitor.isFaceEnrolled()) {
String message = mContext.getString(R.string.keyguard_retry);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java
index eacb18e..14d0d7e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/CentralSurfacesDependenciesModule.java
@@ -300,7 +300,7 @@
@Override
public boolean isShowingAlternateAuthOnUnlock() {
- return statusBarKeyguardViewManager.get().shouldShowAltAuth();
+ return statusBarKeyguardViewManager.get().canShowAlternateBouncer();
}
};
return new DialogLaunchAnimator(callback, interactionJankMonitor);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
index b2628e4..6f4d6d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
@@ -719,7 +719,7 @@
*/
public boolean isBouncerInTransit() {
return mStatusBarKeyguardViewManager != null
- && mStatusBarKeyguardViewManager.isBouncerInTransit();
+ && mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit();
}
/**
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 6e68079..f72f1bc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
@@ -480,7 +480,7 @@
break;
case MODE_SHOW_BOUNCER:
Trace.beginSection("MODE_SHOW_BOUNCER");
- mKeyguardViewController.showBouncer(true);
+ mKeyguardViewController.showPrimaryBouncer(true);
Trace.endSection();
break;
case MODE_WAKE_AND_UNLOCK_FROM_DREAM:
@@ -560,7 +560,7 @@
return MODE_WAKE_AND_UNLOCK_FROM_DREAM;
}
if (mKeyguardStateController.isShowing()) {
- if (mKeyguardViewController.bouncerIsOrWillBeShowing() && unlockingAllowed) {
+ if (mKeyguardViewController.primaryBouncerIsOrWillBeShowing() && unlockingAllowed) {
return MODE_DISMISS_BOUNCER;
} else if (unlockingAllowed) {
return MODE_UNLOCK_COLLAPSING;
@@ -603,7 +603,7 @@
return MODE_UNLOCK_COLLAPSING;
}
if (mKeyguardStateController.isShowing()) {
- if ((mKeyguardViewController.bouncerIsOrWillBeShowing()
+ if ((mKeyguardViewController.primaryBouncerIsOrWillBeShowing()
|| mKeyguardBypassController.getAltBouncerShowing()) && unlockingAllowed) {
return MODE_DISMISS_BOUNCER;
} else if (unlockingAllowed && (bypass || mAuthController.isUdfpsFingerDown())) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
index dc37082..33d4d83 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
@@ -456,7 +456,11 @@
void setTransitionToFullShadeProgress(float transitionToFullShadeProgress);
- void setBouncerHiddenFraction(float expansion);
+ /**
+ * Sets the amount of progress to the bouncer being fully hidden/visible. 1 means the bouncer
+ * is fully hidden, while 0 means the bouncer is visible.
+ */
+ void setPrimaryBouncerHiddenFraction(float expansion);
@VisibleForTesting
void updateScrimController();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 6e9b02a..cc4b7eb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -3322,9 +3322,9 @@
// lock screen where users can use the UDFPS affordance to enter the device
mStatusBarKeyguardViewManager.reset(true);
} else if (mState == StatusBarState.KEYGUARD
- && !mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()
+ && !mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing()
&& isKeyguardSecure()) {
- mStatusBarKeyguardViewManager.showGenericBouncer(true /* scrimmed */);
+ mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
}
}
}
@@ -3806,7 +3806,7 @@
* is fully hidden, while 0 means the bouncer is visible.
*/
@Override
- public void setBouncerHiddenFraction(float expansion) {
+ public void setPrimaryBouncerHiddenFraction(float expansion) {
mScrimController.setBouncerHiddenFraction(expansion);
}
@@ -3828,7 +3828,7 @@
mNotificationPanelViewController.isLaunchingAffordanceWithPreview();
mScrimController.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);
- if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
+ if (mStatusBarKeyguardViewManager.isShowingAlternateBouncer()) {
if (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED
|| mTransitionToFullShadeProgress > 0f) {
mScrimController.transitionTo(ScrimState.AUTH_SCRIMMED_SHADE);
@@ -3839,7 +3839,7 @@
// Bouncer needs the front scrim when it's on top of an activity,
// tapping on a notification, editing QS or being dismissed by
// FLAG_DISMISS_KEYGUARD_ACTIVITY.
- ScrimState state = mStatusBarKeyguardViewManager.bouncerNeedsScrimming()
+ ScrimState state = mStatusBarKeyguardViewManager.primaryBouncerNeedsScrimming()
? ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER;
mScrimController.transitionTo(state);
} else if (launchingAffordanceWithPreview) {
@@ -4148,7 +4148,7 @@
*/
@Override
public boolean isBouncerShowingScrimmed() {
- return isBouncerShowing() && mStatusBarKeyguardViewManager.bouncerNeedsScrimming();
+ return isBouncerShowing() && mStatusBarKeyguardViewManager.primaryBouncerNeedsScrimming();
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
index b2a9509..532b8b8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -55,13 +55,13 @@
import javax.inject.Inject;
/**
- * A class which manages the bouncer on the lockscreen.
+ * A class which manages the primary (pin/pattern/password) bouncer on the lockscreen.
* @deprecated Use KeyguardBouncerRepository
*/
@Deprecated
public class KeyguardBouncer {
- private static final String TAG = "KeyguardBouncer";
+ private static final String TAG = "PrimaryKeyguardBouncer";
static final long BOUNCER_FACE_DELAY = 1200;
public static final float ALPHA_EXPANSION_THRESHOLD = 0.95f;
/**
@@ -78,7 +78,7 @@
private final FalsingCollector mFalsingCollector;
private final DismissCallbackRegistry mDismissCallbackRegistry;
private final Handler mHandler;
- private final List<BouncerExpansionCallback> mExpansionCallbacks = new ArrayList<>();
+ private final List<PrimaryBouncerExpansionCallback> mExpansionCallbacks = new ArrayList<>();
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private final KeyguardStateController mKeyguardStateController;
private final KeyguardSecurityModel mKeyguardSecurityModel;
@@ -126,7 +126,7 @@
private KeyguardBouncer(Context context, ViewMediatorCallback callback,
ViewGroup container,
DismissCallbackRegistry dismissCallbackRegistry, FalsingCollector falsingCollector,
- BouncerExpansionCallback expansionCallback,
+ PrimaryBouncerExpansionCallback expansionCallback,
KeyguardStateController keyguardStateController,
KeyguardUpdateMonitor keyguardUpdateMonitor,
KeyguardBypassController keyguardBypassController, @Main Handler handler,
@@ -571,37 +571,37 @@
}
private void dispatchFullyShown() {
- for (BouncerExpansionCallback callback : mExpansionCallbacks) {
+ for (PrimaryBouncerExpansionCallback callback : mExpansionCallbacks) {
callback.onFullyShown();
}
}
private void dispatchStartingToHide() {
- for (BouncerExpansionCallback callback : mExpansionCallbacks) {
+ for (PrimaryBouncerExpansionCallback callback : mExpansionCallbacks) {
callback.onStartingToHide();
}
}
private void dispatchStartingToShow() {
- for (BouncerExpansionCallback callback : mExpansionCallbacks) {
+ for (PrimaryBouncerExpansionCallback callback : mExpansionCallbacks) {
callback.onStartingToShow();
}
}
private void dispatchFullyHidden() {
- for (BouncerExpansionCallback callback : mExpansionCallbacks) {
+ for (PrimaryBouncerExpansionCallback callback : mExpansionCallbacks) {
callback.onFullyHidden();
}
}
private void dispatchExpansionChanged() {
- for (BouncerExpansionCallback callback : mExpansionCallbacks) {
+ for (PrimaryBouncerExpansionCallback callback : mExpansionCallbacks) {
callback.onExpansionChanged(mExpansion);
}
}
private void dispatchVisibilityChanged() {
- for (BouncerExpansionCallback callback : mExpansionCallbacks) {
+ for (PrimaryBouncerExpansionCallback callback : mExpansionCallbacks) {
callback.onVisibilityChanged(mContainer.getVisibility() == View.VISIBLE);
}
}
@@ -647,7 +647,7 @@
/**
* Adds a callback to listen to bouncer expansion updates.
*/
- public void addBouncerExpansionCallback(BouncerExpansionCallback callback) {
+ public void addBouncerExpansionCallback(PrimaryBouncerExpansionCallback callback) {
if (!mExpansionCallbacks.contains(callback)) {
mExpansionCallbacks.add(callback);
}
@@ -657,11 +657,14 @@
* Removes a previously added callback. If the callback was never added, this methood
* does nothing.
*/
- public void removeBouncerExpansionCallback(BouncerExpansionCallback callback) {
+ public void removeBouncerExpansionCallback(PrimaryBouncerExpansionCallback callback) {
mExpansionCallbacks.remove(callback);
}
- public interface BouncerExpansionCallback {
+ /**
+ * Callback updated when the primary bouncer's show and hide states change.
+ */
+ public interface PrimaryBouncerExpansionCallback {
/**
* Invoked when the bouncer expansion reaches {@link KeyguardBouncer#EXPANSION_VISIBLE}.
* This is NOT called each time the bouncer is shown, but rather only when the fully
@@ -745,7 +748,7 @@
* Construct a KeyguardBouncer that will exist in the given container.
*/
public KeyguardBouncer create(ViewGroup container,
- BouncerExpansionCallback expansionCallback) {
+ PrimaryBouncerExpansionCallback expansionCallback) {
return new KeyguardBouncer(mContext, mCallback, container,
mDismissCallbackRegistry, mFalsingCollector, expansionCallback,
mKeyguardStateController, mKeyguardUpdateMonitor,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index e744c79..86e27ab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -913,7 +913,7 @@
if (mQsExpansion > 0) {
behindAlpha = MathUtils.lerp(behindAlpha, mDefaultScrimAlpha, mQsExpansion);
float tintProgress = mQsExpansion;
- if (mStatusBarKeyguardViewManager.isBouncerInTransit()) {
+ if (mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()) {
// this is case of - on lockscreen - going from expanded QS to bouncer.
// Because mQsExpansion is already interpolated and transition between tints
// is too slow, we want to speed it up and make it more aligned to bouncer
@@ -1096,7 +1096,7 @@
}
private float getInterpolatedFraction() {
- if (mStatusBarKeyguardViewManager.isBouncerInTransit()) {
+ if (mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()) {
return BouncerPanelExpansionCalculator
.aboutToShowBouncerProgress(mPanelExpansionFraction);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index 9e28218..56fb337 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -60,8 +60,8 @@
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.data.BouncerView;
-import com.android.systemui.keyguard.domain.interactor.BouncerCallbackInteractor;
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor;
import com.android.systemui.navigationbar.NavigationBarView;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -78,7 +78,7 @@
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.ViewGroupFadeHelper;
-import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback;
+import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.unfold.FoldAodAnimationController;
@@ -135,62 +135,63 @@
@Nullable
private final FoldAodAnimationController mFoldAodAnimationController;
private KeyguardMessageAreaController<AuthKeyguardMessageArea> mKeyguardMessageAreaController;
- private final BouncerCallbackInteractor mBouncerCallbackInteractor;
- private final BouncerInteractor mBouncerInteractor;
- private final BouncerView mBouncerView;
+ private final PrimaryBouncerCallbackInteractor mPrimaryBouncerCallbackInteractor;
+ private final PrimaryBouncerInteractor mPrimaryBouncerInteractor;
+ private final BouncerView mPrimaryBouncerView;
private final Lazy<com.android.systemui.shade.ShadeController> mShadeController;
- private final BouncerExpansionCallback mExpansionCallback = new BouncerExpansionCallback() {
- private boolean mBouncerAnimating;
+ private final PrimaryBouncerExpansionCallback mExpansionCallback =
+ new PrimaryBouncerExpansionCallback() {
+ private boolean mPrimaryBouncerAnimating;
- @Override
- public void onFullyShown() {
- mBouncerAnimating = false;
- updateStates();
- }
-
- @Override
- public void onStartingToHide() {
- mBouncerAnimating = true;
- updateStates();
- }
-
- @Override
- public void onStartingToShow() {
- mBouncerAnimating = true;
- updateStates();
- }
-
- @Override
- public void onFullyHidden() {
- mBouncerAnimating = false;
- }
-
- @Override
- public void onExpansionChanged(float expansion) {
- if (mBouncerAnimating) {
- mCentralSurfaces.setBouncerHiddenFraction(expansion);
- }
- }
-
- @Override
- public void onVisibilityChanged(boolean isVisible) {
- mCentralSurfaces
- .setBouncerShowingOverDream(
- isVisible && mDreamOverlayStateController.isOverlayActive());
-
- if (!isVisible) {
- mCentralSurfaces.setBouncerHiddenFraction(KeyguardBouncer.EXPANSION_HIDDEN);
+ @Override
+ public void onFullyShown() {
+ mPrimaryBouncerAnimating = false;
+ updateStates();
}
- /* Register predictive back callback when keyguard becomes visible, and unregister
- when it's hidden. */
- if (isVisible) {
- registerBackCallback();
- } else {
- unregisterBackCallback();
+ @Override
+ public void onStartingToHide() {
+ mPrimaryBouncerAnimating = true;
+ updateStates();
}
- }
+
+ @Override
+ public void onStartingToShow() {
+ mPrimaryBouncerAnimating = true;
+ updateStates();
+ }
+
+ @Override
+ public void onFullyHidden() {
+ mPrimaryBouncerAnimating = false;
+ }
+
+ @Override
+ public void onExpansionChanged(float expansion) {
+ if (mPrimaryBouncerAnimating) {
+ mCentralSurfaces.setPrimaryBouncerHiddenFraction(expansion);
+ }
+ }
+
+ @Override
+ public void onVisibilityChanged(boolean isVisible) {
+ mCentralSurfaces.setBouncerShowingOverDream(
+ isVisible && mDreamOverlayStateController.isOverlayActive());
+
+ if (!isVisible) {
+ mCentralSurfaces.setPrimaryBouncerHiddenFraction(
+ KeyguardBouncer.EXPANSION_HIDDEN);
+ }
+
+ /* Register predictive back callback when keyguard becomes visible, and unregister
+ when it's hidden. */
+ if (isVisible) {
+ registerBackCallback();
+ } else {
+ unregisterBackCallback();
+ }
+ }
};
private final OnBackInvokedCallback mOnBackInvokedCallback = () -> {
@@ -223,7 +224,7 @@
private View mNotificationContainer;
- @Nullable protected KeyguardBouncer mBouncer;
+ @Nullable protected KeyguardBouncer mPrimaryBouncer;
protected boolean mRemoteInputActive;
private boolean mGlobalActionsVisible = false;
private boolean mLastGlobalActionsVisible = false;
@@ -236,8 +237,8 @@
protected boolean mFirstUpdate = true;
protected boolean mLastShowing;
protected boolean mLastOccluded;
- private boolean mLastBouncerShowing;
- private boolean mLastBouncerIsOrWillBeShowing;
+ private boolean mLastPrimaryBouncerShowing;
+ private boolean mLastPrimaryBouncerIsOrWillBeShowing;
private boolean mLastBouncerDismissible;
protected boolean mLastRemoteInputActive;
private boolean mLastDozing;
@@ -265,7 +266,7 @@
private final LatencyTracker mLatencyTracker;
private final KeyguardSecurityModel mKeyguardSecurityModel;
private KeyguardBypassController mBypassController;
- @Nullable private AlternateAuthInterceptor mAlternateAuthInterceptor;
+ @Nullable private AlternateBouncer mAlternateBouncer;
private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
new KeyguardUpdateMonitorCallback() {
@@ -300,9 +301,9 @@
LatencyTracker latencyTracker,
KeyguardSecurityModel keyguardSecurityModel,
FeatureFlags featureFlags,
- BouncerCallbackInteractor bouncerCallbackInteractor,
- BouncerInteractor bouncerInteractor,
- BouncerView bouncerView) {
+ PrimaryBouncerCallbackInteractor primaryBouncerCallbackInteractor,
+ PrimaryBouncerInteractor primaryBouncerInteractor,
+ BouncerView primaryBouncerView) {
mContext = context;
mViewMediatorCallback = callback;
mLockPatternUtils = lockPatternUtils;
@@ -320,9 +321,9 @@
mShadeController = shadeController;
mLatencyTracker = latencyTracker;
mKeyguardSecurityModel = keyguardSecurityModel;
- mBouncerCallbackInteractor = bouncerCallbackInteractor;
- mBouncerInteractor = bouncerInteractor;
- mBouncerView = bouncerView;
+ mPrimaryBouncerCallbackInteractor = primaryBouncerCallbackInteractor;
+ mPrimaryBouncerInteractor = primaryBouncerInteractor;
+ mPrimaryBouncerView = primaryBouncerView;
mFoldAodAnimationController = sysUIUnfoldComponent
.map(SysUIUnfoldComponent::getFoldAodAnimationController).orElse(null);
mIsModernBouncerEnabled = featureFlags.isEnabled(Flags.MODERN_BOUNCER);
@@ -340,9 +341,9 @@
ViewGroup container = mCentralSurfaces.getBouncerContainer();
if (mIsModernBouncerEnabled) {
- mBouncerCallbackInteractor.addBouncerExpansionCallback(mExpansionCallback);
+ mPrimaryBouncerCallbackInteractor.addBouncerExpansionCallback(mExpansionCallback);
} else {
- mBouncer = mKeyguardBouncerFactory.create(container, mExpansionCallback);
+ mPrimaryBouncer = mKeyguardBouncerFactory.create(container, mExpansionCallback);
}
mNotificationPanelViewController = notificationPanelViewController;
if (shadeExpansionStateManager != null) {
@@ -361,20 +362,20 @@
* Sets the given alt auth interceptor to null if it's the current auth interceptor. Else,
* does nothing.
*/
- public void removeAlternateAuthInterceptor(@NonNull AlternateAuthInterceptor authInterceptor) {
- if (Objects.equals(mAlternateAuthInterceptor, authInterceptor)) {
- mAlternateAuthInterceptor = null;
- resetAlternateAuth(true);
+ public void removeAlternateAuthInterceptor(@NonNull AlternateBouncer authInterceptor) {
+ if (Objects.equals(mAlternateBouncer, authInterceptor)) {
+ mAlternateBouncer = null;
+ hideAlternateBouncer(true);
}
}
/**
* Sets a new alt auth interceptor.
*/
- public void setAlternateAuthInterceptor(@NonNull AlternateAuthInterceptor authInterceptor) {
- if (!Objects.equals(mAlternateAuthInterceptor, authInterceptor)) {
- mAlternateAuthInterceptor = authInterceptor;
- resetAlternateAuth(false);
+ public void setAlternateBouncer(@NonNull AlternateBouncer authInterceptor) {
+ if (!Objects.equals(mAlternateBouncer, authInterceptor)) {
+ mAlternateBouncer = authInterceptor;
+ hideAlternateBouncer(false);
}
}
@@ -458,48 +459,48 @@
if (mDozing && !mPulsing) {
return;
} else if (mNotificationPanelViewController.isUnlockHintRunning()) {
- if (mBouncer != null) {
- mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
} else {
- mBouncerInteractor.setPanelExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
+ mPrimaryBouncerInteractor.setPanelExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
}
} else if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED) {
// Don't expand to the bouncer. Instead transition back to the lock screen (see
// CentralSurfaces#showBouncerOrLockScreenIfKeyguard)
return;
- } else if (bouncerNeedsScrimming()) {
- if (mBouncer != null) {
- mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
+ } else if (primaryBouncerNeedsScrimming()) {
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
} else {
- mBouncerInteractor.setPanelExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
+ mPrimaryBouncerInteractor.setPanelExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
}
} else if (mKeyguardStateController.isShowing() && !hideBouncerOverDream) {
if (!isWakeAndUnlocking()
&& !(mBiometricUnlockController.getMode() == MODE_DISMISS_BOUNCER)
&& !isUnlockCollapsing()) {
- if (mBouncer != null) {
- mBouncer.setExpansion(fraction);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setExpansion(fraction);
} else {
- mBouncerInteractor.setPanelExpansion(fraction);
+ mPrimaryBouncerInteractor.setPanelExpansion(fraction);
}
}
if (fraction != KeyguardBouncer.EXPANSION_HIDDEN && tracking
&& !mKeyguardStateController.canDismissLockScreen()
- && !bouncerIsShowing()
+ && !primaryBouncerIsShowing()
&& !bouncerIsAnimatingAway()) {
- if (mBouncer != null) {
- mBouncer.show(false /* resetSecuritySelection */, false /* scrimmed */);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.show(false /* resetSecuritySelection */, false /* scrimmed */);
} else {
- mBouncerInteractor.show(/* isScrimmed= */false);
+ mPrimaryBouncerInteractor.show(/* isScrimmed= */false);
}
}
- } else if (!mKeyguardStateController.isShowing() && isBouncerInTransit()) {
+ } else if (!mKeyguardStateController.isShowing() && isPrimaryBouncerInTransit()) {
// Keyguard is not visible anymore, but expansion animation was still running.
// We need to hide the bouncer, otherwise it will be stuck in transit.
- if (mBouncer != null) {
- mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
} else {
- mBouncerInteractor.setPanelExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
+ mPrimaryBouncerInteractor.setPanelExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
}
} else if (mPulsing && fraction == KeyguardBouncer.EXPANSION_VISIBLE) {
// Panel expanded while pulsing but didn't translate the bouncer (because we are
@@ -543,17 +544,17 @@
if (needsFullscreenBouncer() && !mDozing) {
// The keyguard might be showing (already). So we need to hide it.
mCentralSurfaces.hideKeyguard();
- if (mBouncer != null) {
- mBouncer.show(true /* resetSecuritySelection */);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.show(true /* resetSecuritySelection */);
} else {
- mBouncerInteractor.show(true);
+ mPrimaryBouncerInteractor.show(true);
}
} else {
mCentralSurfaces.showKeyguard();
if (hideBouncerWhenShowing) {
hideBouncer(false /* destroyView */);
- if (mBouncer != null) {
- mBouncer.prepare();
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.prepare();
}
}
}
@@ -561,23 +562,25 @@
}
/**
- * If applicable, shows the alternate authentication bouncer. Else, shows the input
- * (pin/password/pattern) bouncer.
- * @param scrimmed true when the input bouncer should show scrimmed, false when the user will be
- * dragging it and translation should be deferred {@see KeyguardBouncer#show(boolean, boolean)}
+ *
+ * If possible, shows the alternate bouncer. Else, shows the primary (pin/pattern/password)
+ * bouncer.
+ * @param scrimmed true when the primary bouncer should show scrimmed,
+ * false when the user will be dragging it and translation should be deferred
+ * {@see KeyguardBouncer#show(boolean, boolean)}
*/
- public void showGenericBouncer(boolean scrimmed) {
- if (shouldShowAltAuth()) {
- updateAlternateAuthShowing(mAlternateAuthInterceptor.showAlternateAuthBouncer());
+ public void showBouncer(boolean scrimmed) {
+ if (canShowAlternateBouncer()) {
+ updateAlternateBouncerShowing(mAlternateBouncer.showAlternateBouncer());
return;
}
- showBouncer(scrimmed);
+ showPrimaryBouncer(scrimmed);
}
- /** Whether we should show the alternate authentication instead of the traditional bouncer. */
- public boolean shouldShowAltAuth() {
- return mAlternateAuthInterceptor != null
+ /** Whether we can show the alternate bouncer instead of the primary bouncer. */
+ public boolean canShowAlternateBouncer() {
+ return mAlternateBouncer != null
&& mKeyguardUpdateManager.isUnlockingWithBiometricAllowed(true);
}
@@ -586,10 +589,10 @@
*/
@VisibleForTesting
void hideBouncer(boolean destroyView) {
- if (mBouncer != null) {
- mBouncer.hide(destroyView);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.hide(destroyView);
} else {
- mBouncerInteractor.hide();
+ mPrimaryBouncerInteractor.hide();
}
if (mKeyguardStateController.isShowing()) {
// If we were showing the bouncer and then aborting, we need to also clear out any
@@ -600,19 +603,19 @@
}
/**
- * Shows the keyguard input bouncer - the password challenge on the lock screen
+ * Shows the primary bouncer - the pin/pattern/password challenge on the lock screen.
*
* @param scrimmed true when the bouncer should show scrimmed, false when the user will be
* dragging it and translation should be deferred {@see KeyguardBouncer#show(boolean, boolean)}
*/
- public void showBouncer(boolean scrimmed) {
- resetAlternateAuth(false);
+ public void showPrimaryBouncer(boolean scrimmed) {
+ hideAlternateBouncer(false);
if (mKeyguardStateController.isShowing() && !isBouncerShowing()) {
- if (mBouncer != null) {
- mBouncer.show(false /* resetSecuritySelection */, scrimmed);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.show(false /* resetSecuritySelection */, scrimmed);
} else {
- mBouncerInteractor.show(scrimmed);
+ mPrimaryBouncerInteractor.show(scrimmed);
}
}
updateStates();
@@ -644,42 +647,41 @@
// If there is an an alternate auth interceptor (like the UDFPS), show that one
// instead of the bouncer.
- if (shouldShowAltAuth()) {
+ if (canShowAlternateBouncer()) {
if (!afterKeyguardGone) {
- if (mBouncer != null) {
- mBouncer.setDismissAction(mAfterKeyguardGoneAction,
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setDismissAction(mAfterKeyguardGoneAction,
mKeyguardGoneCancelAction);
} else {
- mBouncerInteractor.setDismissAction(mAfterKeyguardGoneAction,
+ mPrimaryBouncerInteractor.setDismissAction(mAfterKeyguardGoneAction,
mKeyguardGoneCancelAction);
}
mAfterKeyguardGoneAction = null;
mKeyguardGoneCancelAction = null;
}
- updateAlternateAuthShowing(
- mAlternateAuthInterceptor.showAlternateAuthBouncer());
+ updateAlternateBouncerShowing(mAlternateBouncer.showAlternateBouncer());
return;
}
if (afterKeyguardGone) {
// we'll handle the dismiss action after keyguard is gone, so just show the
// bouncer
- if (mBouncer != null) {
- mBouncer.show(false /* resetSecuritySelection */);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.show(false /* resetSecuritySelection */);
} else {
- mBouncerInteractor.show(/* isScrimmed= */true);
+ mPrimaryBouncerInteractor.show(/* isScrimmed= */true);
}
} else {
// after authentication success, run dismiss action with the option to defer
// hiding the keyguard based on the return value of the OnDismissAction
- if (mBouncer != null) {
- mBouncer.showWithDismissAction(mAfterKeyguardGoneAction,
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.showWithDismissAction(mAfterKeyguardGoneAction,
mKeyguardGoneCancelAction);
} else {
- mBouncerInteractor.setDismissAction(
+ mPrimaryBouncerInteractor.setDismissAction(
mAfterKeyguardGoneAction, mKeyguardGoneCancelAction);
- mBouncerInteractor.show(/* isScrimmed= */true);
+ mPrimaryBouncerInteractor.show(/* isScrimmed= */true);
}
// bouncer will handle the dismiss action, so we no longer need to track it here
mAfterKeyguardGoneAction = null;
@@ -724,28 +726,28 @@
} else {
showBouncerOrKeyguard(hideBouncerWhenShowing);
}
- resetAlternateAuth(false);
+ hideAlternateBouncer(false);
mKeyguardUpdateManager.sendKeyguardReset();
updateStates();
}
}
@Override
- public void resetAlternateAuth(boolean forceUpdateScrim) {
- final boolean updateScrim = (mAlternateAuthInterceptor != null
- && mAlternateAuthInterceptor.hideAlternateAuthBouncer())
+ public void hideAlternateBouncer(boolean forceUpdateScrim) {
+ final boolean updateScrim = (mAlternateBouncer != null
+ && mAlternateBouncer.hideAlternateBouncer())
|| forceUpdateScrim;
- updateAlternateAuthShowing(updateScrim);
+ updateAlternateBouncerShowing(updateScrim);
}
- private void updateAlternateAuthShowing(boolean updateScrim) {
- final boolean isShowingAltAuth = isShowingAlternateAuth();
+ private void updateAlternateBouncerShowing(boolean updateScrim) {
+ final boolean isShowingAlternateBouncer = isShowingAlternateBouncer();
if (mKeyguardMessageAreaController != null) {
- mKeyguardMessageAreaController.setIsVisible(isShowingAltAuth);
+ mKeyguardMessageAreaController.setIsVisible(isShowingAlternateBouncer);
mKeyguardMessageAreaController.setMessage("");
}
- mBypassController.setAltBouncerShowing(isShowingAltAuth);
- mKeyguardUpdateManager.setUdfpsBouncerShowing(isShowingAltAuth);
+ mBypassController.setAltBouncerShowing(isShowingAlternateBouncer);
+ mKeyguardUpdateManager.setUdfpsBouncerShowing(isShowingAlternateBouncer);
if (updateScrim) {
mCentralSurfaces.updateScrimController();
@@ -782,10 +784,10 @@
@Override
public void onFinishedGoingToSleep() {
- if (mBouncer != null) {
- mBouncer.onScreenTurnedOff();
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.onScreenTurnedOff();
} else {
- mBouncerInteractor.onScreenTurnedOff();
+ mPrimaryBouncerInteractor.onScreenTurnedOff();
}
}
@@ -870,18 +872,18 @@
// by a FLAG_DISMISS_KEYGUARD_ACTIVITY.
reset(isOccluding /* hideBouncerWhenShowing*/);
}
- if (animate && !isOccluded && isShowing && !bouncerIsShowing()) {
+ if (animate && !isOccluded && isShowing && !primaryBouncerIsShowing()) {
mCentralSurfaces.animateKeyguardUnoccluding();
}
}
@Override
public void startPreHideAnimation(Runnable finishRunnable) {
- if (bouncerIsShowing()) {
- if (mBouncer != null) {
- mBouncer.startPreHideAnimation(finishRunnable);
+ if (primaryBouncerIsShowing()) {
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.startPreHideAnimation(finishRunnable);
} else {
- mBouncerInteractor.startDisappearAnimation(finishRunnable);
+ mPrimaryBouncerInteractor.startDisappearAnimation(finishRunnable);
}
mNotificationPanelViewController.startBouncerPreHideAnimation();
@@ -994,13 +996,13 @@
updateResources();
return;
}
- boolean wasShowing = bouncerIsShowing();
- boolean wasScrimmed = bouncerIsScrimmed();
+ boolean wasShowing = primaryBouncerIsShowing();
+ boolean wasScrimmed = primaryBouncerIsScrimmed();
hideBouncer(true /* destroyView */);
- mBouncer.prepare();
+ mPrimaryBouncer.prepare();
- if (wasShowing) showBouncer(wasScrimmed);
+ if (wasShowing) showPrimaryBouncer(wasScrimmed);
}
public void onKeyguardFadedAway() {
@@ -1045,8 +1047,8 @@
* WARNING: This method might cause Binder calls.
*/
public boolean isSecure() {
- if (mBouncer != null) {
- return mBouncer.isSecure();
+ if (mPrimaryBouncer != null) {
+ return mPrimaryBouncer.isSecure();
}
return mKeyguardSecurityModel.getSecurityMode(
@@ -1060,7 +1062,7 @@
* @return whether a back press can be handled right now.
*/
public boolean canHandleBackPressed() {
- return bouncerIsShowing();
+ return primaryBouncerIsShowing();
}
/**
@@ -1073,7 +1075,7 @@
mCentralSurfaces.endAffordanceLaunch();
// The second condition is for SIM card locked bouncer
- if (bouncerIsScrimmed() && !needsFullscreenBouncer()) {
+ if (primaryBouncerIsScrimmed() && !needsFullscreenBouncer()) {
hideBouncer(false);
updateStates();
} else {
@@ -1094,27 +1096,27 @@
@Override
public boolean isBouncerShowing() {
- return bouncerIsShowing() || isShowingAlternateAuth();
+ return primaryBouncerIsShowing() || isShowingAlternateBouncer();
}
@Override
- public boolean bouncerIsOrWillBeShowing() {
- return isBouncerShowing() || isBouncerInTransit();
+ public boolean primaryBouncerIsOrWillBeShowing() {
+ return isBouncerShowing() || isPrimaryBouncerInTransit();
}
public boolean isFullscreenBouncer() {
- if (mBouncerView.getDelegate() != null) {
- return mBouncerView.getDelegate().isFullScreenBouncer();
+ if (mPrimaryBouncerView.getDelegate() != null) {
+ return mPrimaryBouncerView.getDelegate().isFullScreenBouncer();
}
- return mBouncer != null && mBouncer.isFullscreenBouncer();
+ return mPrimaryBouncer != null && mPrimaryBouncer.isFullscreenBouncer();
}
/**
* Clear out any potential actions that were saved to run when the device is unlocked
*/
public void cancelPostAuthActions() {
- if (bouncerIsOrWillBeShowing()) {
- return; // allow bouncer to trigger saved actions
+ if (primaryBouncerIsOrWillBeShowing()) {
+ return; // allow the primary bouncer to trigger saved actions
}
mAfterKeyguardGoneAction = null;
mDismissActionWillAnimateOnKeyguard = false;
@@ -1153,25 +1155,25 @@
}
boolean showing = mKeyguardStateController.isShowing();
boolean occluded = mKeyguardStateController.isOccluded();
- boolean bouncerShowing = bouncerIsShowing();
- boolean bouncerIsOrWillBeShowing = bouncerIsOrWillBeShowing();
- boolean bouncerDismissible = !isFullscreenBouncer();
+ boolean primaryBouncerShowing = primaryBouncerIsShowing();
+ boolean primaryBouncerIsOrWillBeShowing = primaryBouncerIsOrWillBeShowing();
+ boolean primaryBouncerDismissible = !isFullscreenBouncer();
boolean remoteInputActive = mRemoteInputActive;
- if ((bouncerDismissible || !showing || remoteInputActive) !=
- (mLastBouncerDismissible || !mLastShowing || mLastRemoteInputActive)
+ if ((primaryBouncerDismissible || !showing || remoteInputActive)
+ != (mLastBouncerDismissible || !mLastShowing || mLastRemoteInputActive)
|| mFirstUpdate) {
- if (bouncerDismissible || !showing || remoteInputActive) {
- if (mBouncer != null) {
- mBouncer.setBackButtonEnabled(true);
+ if (primaryBouncerDismissible || !showing || remoteInputActive) {
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setBackButtonEnabled(true);
} else {
- mBouncerInteractor.setBackButtonEnabled(true);
+ mPrimaryBouncerInteractor.setBackButtonEnabled(true);
}
} else {
- if (mBouncer != null) {
- mBouncer.setBackButtonEnabled(false);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.setBackButtonEnabled(false);
} else {
- mBouncerInteractor.setBackButtonEnabled(false);
+ mPrimaryBouncerInteractor.setBackButtonEnabled(false);
}
}
}
@@ -1182,23 +1184,23 @@
updateNavigationBarVisibility(navBarVisible);
}
- if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
- mNotificationShadeWindowController.setBouncerShowing(bouncerShowing);
- mCentralSurfaces.setBouncerShowing(bouncerShowing);
+ if (primaryBouncerShowing != mLastPrimaryBouncerShowing || mFirstUpdate) {
+ mNotificationShadeWindowController.setBouncerShowing(primaryBouncerShowing);
+ mCentralSurfaces.setBouncerShowing(primaryBouncerShowing);
}
- if (bouncerIsOrWillBeShowing != mLastBouncerIsOrWillBeShowing || mFirstUpdate
- || bouncerShowing != mLastBouncerShowing) {
- mKeyguardUpdateManager.sendKeyguardBouncerChanged(bouncerIsOrWillBeShowing,
- bouncerShowing);
+ if (primaryBouncerIsOrWillBeShowing != mLastPrimaryBouncerIsOrWillBeShowing || mFirstUpdate
+ || primaryBouncerShowing != mLastPrimaryBouncerShowing) {
+ mKeyguardUpdateManager.sendPrimaryBouncerChanged(primaryBouncerIsOrWillBeShowing,
+ primaryBouncerShowing);
}
mFirstUpdate = false;
mLastShowing = showing;
mLastGlobalActionsVisible = mGlobalActionsVisible;
mLastOccluded = occluded;
- mLastBouncerShowing = bouncerShowing;
- mLastBouncerIsOrWillBeShowing = bouncerIsOrWillBeShowing;
- mLastBouncerDismissible = bouncerDismissible;
+ mLastPrimaryBouncerShowing = primaryBouncerShowing;
+ mLastPrimaryBouncerIsOrWillBeShowing = primaryBouncerIsOrWillBeShowing;
+ mLastBouncerDismissible = primaryBouncerDismissible;
mLastRemoteInputActive = remoteInputActive;
mLastDozing = mDozing;
mLastPulsing = mPulsing;
@@ -1242,7 +1244,7 @@
|| mPulsing && !mIsDocked)
&& mGesturalNav;
return (!keyguardVisible && !hideWhileDozing && !mScreenOffAnimationPlaying
- || bouncerIsShowing()
+ || primaryBouncerIsShowing()
|| mRemoteInputActive
|| keyguardWithGestureNav
|| mGlobalActionsVisible);
@@ -1258,32 +1260,32 @@
&& !mLastScreenOffAnimationPlaying || mLastPulsing && !mLastIsDocked)
&& mLastGesturalNav;
return (!keyguardShowing && !hideWhileDozing && !mLastScreenOffAnimationPlaying
- || mLastBouncerShowing || mLastRemoteInputActive || keyguardWithGestureNav
+ || mLastPrimaryBouncerShowing || mLastRemoteInputActive || keyguardWithGestureNav
|| mLastGlobalActionsVisible);
}
public boolean shouldDismissOnMenuPressed() {
- if (mBouncerView.getDelegate() != null) {
- return mBouncerView.getDelegate().shouldDismissOnMenuPressed();
+ if (mPrimaryBouncerView.getDelegate() != null) {
+ return mPrimaryBouncerView.getDelegate().shouldDismissOnMenuPressed();
}
- return mBouncer != null && mBouncer.shouldDismissOnMenuPressed();
+ return mPrimaryBouncer != null && mPrimaryBouncer.shouldDismissOnMenuPressed();
}
public boolean interceptMediaKey(KeyEvent event) {
- if (mBouncerView.getDelegate() != null) {
- return mBouncerView.getDelegate().interceptMediaKey(event);
+ if (mPrimaryBouncerView.getDelegate() != null) {
+ return mPrimaryBouncerView.getDelegate().interceptMediaKey(event);
}
- return mBouncer != null && mBouncer.interceptMediaKey(event);
+ return mPrimaryBouncer != null && mPrimaryBouncer.interceptMediaKey(event);
}
/**
* @return true if the pre IME back event should be handled
*/
public boolean dispatchBackKeyEventPreIme() {
- if (mBouncerView.getDelegate() != null) {
- return mBouncerView.getDelegate().dispatchBackKeyEventPreIme();
+ if (mPrimaryBouncerView.getDelegate() != null) {
+ return mPrimaryBouncerView.getDelegate().dispatchBackKeyEventPreIme();
}
- return mBouncer != null && mBouncer.dispatchBackKeyEventPreIme();
+ return mPrimaryBouncer != null && mPrimaryBouncer.dispatchBackKeyEventPreIme();
}
public void readyForKeyguardDone() {
@@ -1329,29 +1331,29 @@
* fingerprint.
*/
public void notifyKeyguardAuthenticated(boolean strongAuth) {
- if (mBouncer != null) {
- mBouncer.notifyKeyguardAuthenticated(strongAuth);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.notifyKeyguardAuthenticated(strongAuth);
} else {
- mBouncerInteractor.notifyKeyguardAuthenticated(strongAuth);
+ mPrimaryBouncerInteractor.notifyKeyguardAuthenticated(strongAuth);
}
- if (mAlternateAuthInterceptor != null && isShowingAlternateAuth()) {
- resetAlternateAuth(false);
+ if (mAlternateBouncer != null && isShowingAlternateBouncer()) {
+ hideAlternateBouncer(false);
executeAfterKeyguardGoneAction();
}
}
/** Display security message to relevant KeyguardMessageArea. */
public void setKeyguardMessage(String message, ColorStateList colorState) {
- if (isShowingAlternateAuth()) {
+ if (isShowingAlternateBouncer()) {
if (mKeyguardMessageAreaController != null) {
mKeyguardMessageAreaController.setMessage(message);
}
} else {
- if (mBouncer != null) {
- mBouncer.showMessage(message, colorState);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.showMessage(message, colorState);
} else {
- mBouncerInteractor.showMessage(message, colorState);
+ mPrimaryBouncerInteractor.showMessage(message, colorState);
}
}
}
@@ -1390,12 +1392,15 @@
}
}
- public boolean bouncerNeedsScrimming() {
+ /**
+ * Whether the primary bouncer requires scrimming.
+ */
+ public boolean primaryBouncerNeedsScrimming() {
// When a dream overlay is active, scrimming will cause any expansion to immediately expand.
return (mKeyguardStateController.isOccluded()
&& !mDreamOverlayStateController.isOverlayActive())
- || bouncerWillDismissWithAction()
- || (bouncerIsShowing() && bouncerIsScrimmed())
+ || primaryBouncerWillDismissWithAction()
+ || (primaryBouncerIsShowing() && primaryBouncerIsScrimmed())
|| isFullscreenBouncer();
}
@@ -1405,10 +1410,10 @@
* configuration.
*/
public void updateResources() {
- if (mBouncer != null) {
- mBouncer.updateResources();
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.updateResources();
} else {
- mBouncerInteractor.updateResources();
+ mPrimaryBouncerInteractor.updateResources();
}
}
@@ -1420,19 +1425,20 @@
pw.println(" mAfterKeyguardGoneRunnables: " + mAfterKeyguardGoneRunnables);
pw.println(" mPendingWakeupAction: " + mPendingWakeupAction);
pw.println(" isBouncerShowing(): " + isBouncerShowing());
- pw.println(" bouncerIsOrWillBeShowing(): " + bouncerIsOrWillBeShowing());
+ pw.println(" bouncerIsOrWillBeShowing(): " + primaryBouncerIsOrWillBeShowing());
pw.println(" Registered KeyguardViewManagerCallbacks:");
for (KeyguardViewManagerCallback callback : mCallbacks) {
pw.println(" " + callback);
}
- if (mBouncer != null) {
- mBouncer.dump(pw);
+ if (mPrimaryBouncer != null) {
+ pw.println("PrimaryBouncer:");
+ mPrimaryBouncer.dump(pw);
}
- if (mAlternateAuthInterceptor != null) {
- pw.println("AltAuthInterceptor: ");
- mAlternateAuthInterceptor.dump(pw);
+ if (mAlternateBouncer != null) {
+ pw.println("AlternateBouncer:");
+ mAlternateBouncer.dump(pw);
}
}
@@ -1480,13 +1486,12 @@
}
@Nullable
- public KeyguardBouncer getBouncer() {
- return mBouncer;
+ public KeyguardBouncer getPrimaryBouncer() {
+ return mPrimaryBouncer;
}
- public boolean isShowingAlternateAuth() {
- return mAlternateAuthInterceptor != null
- && mAlternateAuthInterceptor.isShowingAlternateAuthBouncer();
+ public boolean isShowingAlternateBouncer() {
+ return mAlternateBouncer != null && mAlternateBouncer.isShowingAlternateBouncer();
}
/**
@@ -1500,10 +1505,10 @@
/** Update keyguard position based on a tapped X coordinate. */
public void updateKeyguardPosition(float x) {
- if (mBouncer != null) {
- mBouncer.updateKeyguardPosition(x);
+ if (mPrimaryBouncer != null) {
+ mPrimaryBouncer.updateKeyguardPosition(x);
} else {
- mBouncerInteractor.setKeyguardPosition(x);
+ mPrimaryBouncerInteractor.setKeyguardPosition(x);
}
}
@@ -1535,41 +1540,41 @@
*/
public void requestFp(boolean request, int udfpsColor) {
mKeyguardUpdateManager.requestFingerprintAuthOnOccludingApp(request);
- if (mAlternateAuthInterceptor != null) {
- mAlternateAuthInterceptor.requestUdfps(request, udfpsColor);
+ if (mAlternateBouncer != null) {
+ mAlternateBouncer.requestUdfps(request, udfpsColor);
}
}
/**
* Returns if bouncer expansion is between 0 and 1 non-inclusive.
*/
- public boolean isBouncerInTransit() {
- if (mBouncer != null) {
- return mBouncer.inTransit();
+ public boolean isPrimaryBouncerInTransit() {
+ if (mPrimaryBouncer != null) {
+ return mPrimaryBouncer.inTransit();
} else {
- return mBouncerInteractor.isInTransit();
+ return mPrimaryBouncerInteractor.isInTransit();
}
}
/**
* Returns if bouncer is showing
*/
- public boolean bouncerIsShowing() {
- if (mBouncer != null) {
- return mBouncer.isShowing();
+ public boolean primaryBouncerIsShowing() {
+ if (mPrimaryBouncer != null) {
+ return mPrimaryBouncer.isShowing();
} else {
- return mBouncerInteractor.isFullyShowing();
+ return mPrimaryBouncerInteractor.isFullyShowing();
}
}
/**
* Returns if bouncer is scrimmed
*/
- public boolean bouncerIsScrimmed() {
- if (mBouncer != null) {
- return mBouncer.isScrimmed();
+ public boolean primaryBouncerIsScrimmed() {
+ if (mPrimaryBouncer != null) {
+ return mPrimaryBouncer.isScrimmed();
} else {
- return mBouncerInteractor.isScrimmed();
+ return mPrimaryBouncerInteractor.isScrimmed();
}
}
@@ -1577,10 +1582,10 @@
* Returns if bouncer is animating away
*/
public boolean bouncerIsAnimatingAway() {
- if (mBouncer != null) {
- return mBouncer.isAnimatingAway();
+ if (mPrimaryBouncer != null) {
+ return mPrimaryBouncer.isAnimatingAway();
} else {
- return mBouncerInteractor.isAnimatingAway();
+ return mPrimaryBouncerInteractor.isAnimatingAway();
}
}
@@ -1588,11 +1593,11 @@
/**
* Returns if bouncer will dismiss with action
*/
- public boolean bouncerWillDismissWithAction() {
- if (mBouncer != null) {
- return mBouncer.willDismissWithAction();
+ public boolean primaryBouncerWillDismissWithAction() {
+ if (mPrimaryBouncer != null) {
+ return mPrimaryBouncer.willDismissWithAction();
} else {
- return mBouncerInteractor.willDismissWithAction();
+ return mPrimaryBouncerInteractor.willDismissWithAction();
}
}
@@ -1607,26 +1612,26 @@
}
/**
- * Delegate used to send show/reset events to an alternate authentication method instead of the
- * regular pin/pattern/password bouncer.
+ * Delegate used to send show and hide events to an alternate authentication method instead of
+ * the regular pin/pattern/password bouncer.
*/
- public interface AlternateAuthInterceptor {
+ public interface AlternateBouncer {
/**
* Show alternate authentication bouncer.
* @return whether alternate auth method was newly shown
*/
- boolean showAlternateAuthBouncer();
+ boolean showAlternateBouncer();
/**
* Hide alternate authentication bouncer
* @return whether the alternate auth method was newly hidden
*/
- boolean hideAlternateAuthBouncer();
+ boolean hideAlternateBouncer();
/**
* @return true if the alternate auth bouncer is showing
*/
- boolean isShowingAlternateAuthBouncer();
+ boolean isShowingAlternateBouncer();
/**
* Use when an app occluding the keyguard would like to give the user ability to
@@ -1638,7 +1643,7 @@
void requestUdfps(boolean requestUdfps, int color);
/**
- * print information for the alternate auth interceptor registered
+ * print information for the alternate bouncer registered
*/
void dump(PrintWriter pw);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java
index 70af77e..8a49850 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java
@@ -133,7 +133,7 @@
if (!row.isPinned()) {
mStatusBarStateController.setLeaveOpenOnKeyguardHide(true);
}
- mStatusBarKeyguardViewManager.showGenericBouncer(true /* scrimmed */);
+ mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
mPendingRemoteInputView = clicked;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java
index e7d9221..678c2d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialogManager.java
@@ -87,7 +87,7 @@
private void updateDialogListeners() {
if (shouldHideAffordance()) {
- mKeyguardViewController.resetAlternateAuth(true);
+ mKeyguardViewController.hideAlternateBouncer(true);
}
for (Listener listener : mListeners) {
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
index 9c14ee6..c6200da 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
@@ -629,7 +629,7 @@
@Test
public void testNoStartAuthenticate_whenAboutToShowBouncer() {
- mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(
+ mKeyguardUpdateMonitor.sendPrimaryBouncerChanged(
/* bouncerIsOrWillBeShowing */ true, /* bouncerFullyShown */ false);
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
@@ -1852,7 +1852,7 @@
}
private void setKeyguardBouncerVisibility(boolean isVisible) {
- mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(isVisible, isVisible);
+ mKeyguardUpdateMonitor.sendPrimaryBouncerChanged(isVisible, isVisible);
mTestableLooper.processAllMessages();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt
index 90948ff..7e061bb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerOverlayTest.kt
@@ -43,7 +43,7 @@
import com.android.systemui.animation.ActivityLaunchAnimator
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeExpansionStateManager
import com.android.systemui.statusbar.LockscreenShadeTransitionController
@@ -106,7 +106,7 @@
@Mock private lateinit var udfpsEnrollView: UdfpsEnrollView
@Mock private lateinit var activityLaunchAnimator: ActivityLaunchAnimator
@Mock private lateinit var featureFlags: FeatureFlags
- @Mock private lateinit var bouncerInteractor: BouncerInteractor
+ @Mock private lateinit var mPrimaryBouncerInteractor: PrimaryBouncerInteractor
@Captor private lateinit var layoutParamsCaptor: ArgumentCaptor<WindowManager.LayoutParams>
private val onTouch = { _: View, _: MotionEvent, _: Boolean -> true }
@@ -141,7 +141,7 @@
configurationController, systemClock, keyguardStateController,
unlockedScreenOffAnimationController, udfpsDisplayMode, REQUEST_ID, reason,
controllerCallback, onTouch, activityLaunchAnimator, featureFlags,
- bouncerInteractor, isDebuggable
+ mPrimaryBouncerInteractor, isDebuggable
)
block()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
index 9c7711b..d1142de 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsControllerTest.java
@@ -73,7 +73,7 @@
import com.android.systemui.dump.DumpManager;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.keyguard.ScreenLifecycle;
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shade.ShadeExpansionStateManager;
@@ -192,7 +192,7 @@
@Mock
private AlternateUdfpsTouchProvider mAlternateTouchProvider;
@Mock
- private BouncerInteractor mBouncerInteractor;
+ private PrimaryBouncerInteractor mPrimaryBouncerInteractor;
// Capture listeners so that they can be used to send events
@Captor
@@ -291,7 +291,7 @@
mActivityLaunchAnimator,
Optional.of(mAlternateTouchProvider),
mBiometricsExecutor,
- mBouncerInteractor);
+ mPrimaryBouncerInteractor);
verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture());
mOverlayController = mOverlayCaptor.getValue();
verify(mScreenLifecycle).addObserver(mScreenObserverCaptor.capture());
@@ -405,14 +405,14 @@
// GIVEN overlay was showing and the udfps bouncer is showing
mOverlayController.showUdfpsOverlay(TEST_REQUEST_ID, mOpticalProps.sensorId,
BiometricOverlayConstants.REASON_AUTH_KEYGUARD, mUdfpsOverlayControllerCallback);
- when(mStatusBarKeyguardViewManager.isShowingAlternateAuth()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isShowingAlternateBouncer()).thenReturn(true);
// WHEN the overlay is hidden
mOverlayController.hideUdfpsOverlay(mOpticalProps.sensorId);
mFgExecutor.runAllReady();
// THEN the udfps bouncer is reset
- verify(mStatusBarKeyguardViewManager).resetAlternateAuth(eq(true));
+ verify(mStatusBarKeyguardViewManager).hideAlternateBouncer(eq(true));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerBaseTest.java
index e5c7a42..75629f4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerBaseTest.java
@@ -30,7 +30,7 @@
import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.KeyguardViewMediator;
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shade.ShadeExpansionChangeEvent;
import com.android.systemui.shade.ShadeExpansionListener;
@@ -72,7 +72,7 @@
protected @Mock UdfpsController mUdfpsController;
protected @Mock ActivityLaunchAnimator mActivityLaunchAnimator;
protected @Mock KeyguardBouncer mBouncer;
- protected @Mock BouncerInteractor mBouncerInteractor;
+ protected @Mock PrimaryBouncerInteractor mPrimaryBouncerInteractor;
protected FakeFeatureFlags mFeatureFlags = new FakeFeatureFlags();
protected FakeSystemClock mSystemClock = new FakeSystemClock();
@@ -86,9 +86,9 @@
private @Captor ArgumentCaptor<ShadeExpansionListener> mExpansionListenerCaptor;
protected List<ShadeExpansionListener> mExpansionListeners;
- private @Captor ArgumentCaptor<StatusBarKeyguardViewManager.AlternateAuthInterceptor>
- mAltAuthInterceptorCaptor;
- protected StatusBarKeyguardViewManager.AlternateAuthInterceptor mAltAuthInterceptor;
+ private @Captor ArgumentCaptor<StatusBarKeyguardViewManager.AlternateBouncer>
+ mAlternateBouncerCaptor;
+ protected StatusBarKeyguardViewManager.AlternateBouncer mAlternateBouncer;
private @Captor ArgumentCaptor<KeyguardStateController.Callback>
mKeyguardStateControllerCallbackCaptor;
@@ -131,9 +131,9 @@
}
protected void captureAltAuthInterceptor() {
- verify(mStatusBarKeyguardViewManager).setAlternateAuthInterceptor(
- mAltAuthInterceptorCaptor.capture());
- mAltAuthInterceptor = mAltAuthInterceptorCaptor.getValue();
+ verify(mStatusBarKeyguardViewManager).setAlternateBouncer(
+ mAlternateBouncerCaptor.capture());
+ mAlternateBouncer = mAlternateBouncerCaptor.getValue();
}
protected void captureKeyguardStateControllerCallback() {
@@ -149,7 +149,7 @@
protected UdfpsKeyguardViewController createUdfpsKeyguardViewController(
boolean useModernBouncer) {
mFeatureFlags.set(Flags.MODERN_BOUNCER, useModernBouncer);
- when(mStatusBarKeyguardViewManager.getBouncer()).thenReturn(
+ when(mStatusBarKeyguardViewManager.getPrimaryBouncer()).thenReturn(
useModernBouncer ? null : mBouncer);
return new UdfpsKeyguardViewController(
mView,
@@ -167,6 +167,6 @@
mUdfpsController,
mActivityLaunchAnimator,
mFeatureFlags,
- mBouncerInteractor);
+ mPrimaryBouncerInteractor);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java
index 55b6194..16728b6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java
@@ -46,9 +46,9 @@
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
public class UdfpsKeyguardViewControllerTest extends UdfpsKeyguardViewControllerBaseTest {
- private @Captor ArgumentCaptor<KeyguardBouncer.BouncerExpansionCallback>
+ private @Captor ArgumentCaptor<KeyguardBouncer.PrimaryBouncerExpansionCallback>
mBouncerExpansionCallbackCaptor;
- private KeyguardBouncer.BouncerExpansionCallback mBouncerExpansionCallback;
+ private KeyguardBouncer.PrimaryBouncerExpansionCallback mBouncerExpansionCallback;
@Override
public UdfpsKeyguardViewController createUdfpsKeyguardViewController() {
@@ -63,7 +63,7 @@
captureBouncerExpansionCallback();
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
- when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing()).thenReturn(true);
mBouncerExpansionCallback.onVisibilityChanged(true);
assertTrue(mController.shouldPauseAuth());
@@ -239,13 +239,13 @@
sendStatusBarStateChanged(StatusBarState.SHADE_LOCKED);
assertTrue(mController.shouldPauseAuth());
- mAltAuthInterceptor.showAlternateAuthBouncer(); // force show
+ mAlternateBouncer.showAlternateBouncer(); // force show
assertFalse(mController.shouldPauseAuth());
- assertTrue(mAltAuthInterceptor.isShowingAlternateAuthBouncer());
+ assertTrue(mAlternateBouncer.isShowingAlternateBouncer());
- mAltAuthInterceptor.hideAlternateAuthBouncer(); // stop force show
+ mAlternateBouncer.hideAlternateBouncer(); // stop force show
assertTrue(mController.shouldPauseAuth());
- assertFalse(mAltAuthInterceptor.isShowingAlternateAuthBouncer());
+ assertFalse(mAlternateBouncer.isShowingAlternateBouncer());
}
@Test
@@ -258,7 +258,7 @@
mController.onViewDetached();
// THEN remove alternate auth interceptor
- verify(mStatusBarKeyguardViewManager).removeAlternateAuthInterceptor(mAltAuthInterceptor);
+ verify(mStatusBarKeyguardViewManager).removeAlternateAuthInterceptor(mAlternateBouncer);
}
@Test
@@ -268,14 +268,15 @@
captureAltAuthInterceptor();
// GIVEN udfps bouncer isn't showing
- mAltAuthInterceptor.hideAlternateAuthBouncer();
+ mAlternateBouncer.hideAlternateBouncer();
// WHEN touch is observed outside the view
mController.onTouchOutsideView();
// THEN bouncer / alt auth methods are never called
+ verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean());
verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
- verify(mStatusBarKeyguardViewManager, never()).resetAlternateAuth(anyBoolean());
+ verify(mStatusBarKeyguardViewManager, never()).hideAlternateBouncer(anyBoolean());
}
@Test
@@ -285,32 +286,33 @@
captureAltAuthInterceptor();
// GIVEN udfps bouncer is showing
- mAltAuthInterceptor.showAlternateAuthBouncer();
+ mAlternateBouncer.showAlternateBouncer();
// WHEN touch is observed outside the view 200ms later (just within threshold)
mSystemClock.advanceTime(200);
mController.onTouchOutsideView();
// THEN bouncer / alt auth methods are never called because not enough time has passed
+ verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean());
verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
- verify(mStatusBarKeyguardViewManager, never()).resetAlternateAuth(anyBoolean());
+ verify(mStatusBarKeyguardViewManager, never()).hideAlternateBouncer(anyBoolean());
}
@Test
- public void testShowingUdfpsBouncerOnTouchOutsideAboveThreshold_showInputBouncer() {
+ public void testShowingUdfpsBouncerOnTouchOutsideAboveThreshold_showPrimaryBouncer() {
// GIVEN view is attached
mController.onViewAttached();
captureAltAuthInterceptor();
// GIVEN udfps bouncer is showing
- mAltAuthInterceptor.showAlternateAuthBouncer();
+ mAlternateBouncer.showAlternateBouncer();
// WHEN touch is observed outside the view 205ms later
mSystemClock.advanceTime(205);
mController.onTouchOutsideView();
// THEN show the bouncer
- verify(mStatusBarKeyguardViewManager).showBouncer(eq(true));
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(eq(true));
}
@Test
@@ -341,7 +343,7 @@
when(mResourceContext.getString(anyInt())).thenReturn("test string");
// WHEN status bar expansion is 0 but udfps bouncer is requested
- mAltAuthInterceptor.showAlternateAuthBouncer();
+ mAlternateBouncer.showAlternateBouncer();
// THEN alpha is 255
verify(mView).setUnpausedAlpha(255);
@@ -372,7 +374,7 @@
captureKeyguardStateControllerCallback();
captureAltAuthInterceptor();
updateStatusBarExpansion(1f, true);
- mAltAuthInterceptor.showAlternateAuthBouncer();
+ mAlternateBouncer.showAlternateBouncer();
reset(mView);
// WHEN we're transitioning to the full shade
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerWithCoroutinesTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerWithCoroutinesTest.kt
index 7b19768..68e744e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerWithCoroutinesTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerWithCoroutinesTest.kt
@@ -25,8 +25,8 @@
import com.android.systemui.keyguard.DismissCallbackRegistry
import com.android.systemui.keyguard.data.BouncerView
import com.android.systemui.keyguard.data.repository.KeyguardBouncerRepository
-import com.android.systemui.keyguard.domain.interactor.BouncerCallbackInteractor
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInteractor
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.statusbar.phone.KeyguardBouncer
import com.android.systemui.statusbar.phone.KeyguardBypassController
@@ -59,14 +59,14 @@
}
override fun createUdfpsKeyguardViewController(): UdfpsKeyguardViewController? {
- mBouncerInteractor =
- BouncerInteractor(
+ mPrimaryBouncerInteractor =
+ PrimaryBouncerInteractor(
keyguardBouncerRepository,
mock(BouncerView::class.java),
mock(Handler::class.java),
mKeyguardStateController,
mock(KeyguardSecurityModel::class.java),
- mock(BouncerCallbackInteractor::class.java),
+ mock(PrimaryBouncerCallbackInteractor::class.java),
mock(FalsingCollector::class.java),
mock(DismissCallbackRegistry::class.java),
mock(KeyguardBypassController::class.java),
@@ -86,7 +86,7 @@
// WHEN the bouncer expansion is VISIBLE
val job = mController.listenForBouncerExpansion(this)
- keyguardBouncerRepository.setVisible(true)
+ keyguardBouncerRepository.setPrimaryVisible(true)
keyguardBouncerRepository.setPanelExpansion(KeyguardBouncer.EXPANSION_VISIBLE)
yield()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayContainerViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayContainerViewControllerTest.java
index c234178..517804d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayContainerViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayContainerViewControllerTest.java
@@ -36,10 +36,10 @@
import com.android.keyguard.BouncerPanelExpansionCalculator;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.dreams.complication.ComplicationHostViewController;
-import com.android.systemui.keyguard.domain.interactor.BouncerCallbackInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInteractor;
import com.android.systemui.statusbar.BlurUtils;
import com.android.systemui.statusbar.phone.KeyguardBouncer;
-import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback;
+import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import org.junit.Before;
@@ -90,7 +90,7 @@
ViewRootImpl mViewRoot;
@Mock
- BouncerCallbackInteractor mBouncerCallbackInteractor;
+ PrimaryBouncerCallbackInteractor mPrimaryBouncerCallbackInteractor;
@Mock
DreamOverlayAnimationsController mAnimationsController;
@@ -106,7 +106,7 @@
when(mDreamOverlayContainerView.getResources()).thenReturn(mResources);
when(mDreamOverlayContainerView.getViewTreeObserver()).thenReturn(mViewTreeObserver);
- when(mStatusBarKeyguardViewManager.getBouncer()).thenReturn(mBouncer);
+ when(mStatusBarKeyguardViewManager.getPrimaryBouncer()).thenReturn(mBouncer);
when(mDreamOverlayContainerView.getViewRootImpl()).thenReturn(mViewRoot);
mController = new DreamOverlayContainerViewController(
@@ -121,7 +121,7 @@
MAX_BURN_IN_OFFSET,
BURN_IN_PROTECTION_UPDATE_INTERVAL,
MILLIS_UNTIL_FULL_JITTER,
- mBouncerCallbackInteractor,
+ mPrimaryBouncerCallbackInteractor,
mAnimationsController,
mStateController);
}
@@ -167,8 +167,8 @@
@Test
public void testBouncerAnimation_doesNotApply() {
- final ArgumentCaptor<BouncerExpansionCallback> bouncerExpansionCaptor =
- ArgumentCaptor.forClass(BouncerExpansionCallback.class);
+ final ArgumentCaptor<PrimaryBouncerExpansionCallback> bouncerExpansionCaptor =
+ ArgumentCaptor.forClass(PrimaryBouncerExpansionCallback.class);
mController.onViewAttached();
verify(mBouncer).addBouncerExpansionCallback(bouncerExpansionCaptor.capture());
@@ -178,8 +178,8 @@
@Test
public void testBouncerAnimation_updateBlur() {
- final ArgumentCaptor<BouncerExpansionCallback> bouncerExpansionCaptor =
- ArgumentCaptor.forClass(BouncerExpansionCallback.class);
+ final ArgumentCaptor<PrimaryBouncerExpansionCallback> bouncerExpansionCaptor =
+ ArgumentCaptor.forClass(PrimaryBouncerExpansionCallback.class);
mController.onViewAttached();
verify(mBouncer).addBouncerExpansionCallback(bouncerExpansionCaptor.capture());
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/BouncerCallbackInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/BouncerCallbackInteractorTest.kt
deleted file mode 100644
index 3a61c57..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/BouncerCallbackInteractorTest.kt
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyguard.domain.interactor
-
-import android.view.View
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.statusbar.phone.KeyguardBouncer
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-import org.mockito.Mock
-import org.mockito.Mockito.verify
-import org.mockito.MockitoAnnotations
-
-@SmallTest
-@RunWith(JUnit4::class)
-class BouncerCallbackInteractorTest : SysuiTestCase() {
- private val bouncerCallbackInteractor = BouncerCallbackInteractor()
- @Mock private lateinit var bouncerExpansionCallback: KeyguardBouncer.BouncerExpansionCallback
- @Mock private lateinit var keyguardResetCallback: KeyguardBouncer.KeyguardResetCallback
-
- @Before
- fun setup() {
- MockitoAnnotations.initMocks(this)
- bouncerCallbackInteractor.addBouncerExpansionCallback(bouncerExpansionCallback)
- bouncerCallbackInteractor.addKeyguardResetCallback(keyguardResetCallback)
- }
-
- @Test
- fun testOnFullyShown() {
- bouncerCallbackInteractor.dispatchFullyShown()
- verify(bouncerExpansionCallback).onFullyShown()
- }
-
- @Test
- fun testOnFullyHidden() {
- bouncerCallbackInteractor.dispatchFullyHidden()
- verify(bouncerExpansionCallback).onFullyHidden()
- }
-
- @Test
- fun testOnExpansionChanged() {
- bouncerCallbackInteractor.dispatchExpansionChanged(5f)
- verify(bouncerExpansionCallback).onExpansionChanged(5f)
- }
-
- @Test
- fun testOnVisibilityChanged() {
- bouncerCallbackInteractor.dispatchVisibilityChanged(View.INVISIBLE)
- verify(bouncerExpansionCallback).onVisibilityChanged(false)
- }
-
- @Test
- fun testOnStartingToHide() {
- bouncerCallbackInteractor.dispatchStartingToHide()
- verify(bouncerExpansionCallback).onStartingToHide()
- }
-
- @Test
- fun testOnStartingToShow() {
- bouncerCallbackInteractor.dispatchStartingToShow()
- verify(bouncerExpansionCallback).onStartingToShow()
- }
-
- @Test
- fun testOnKeyguardReset() {
- bouncerCallbackInteractor.dispatchReset()
- verify(keyguardResetCallback).onKeyguardReset()
- }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerCallbackInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerCallbackInteractorTest.kt
new file mode 100644
index 0000000..db9c4e7
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerCallbackInteractorTest.kt
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyguard.domain.interactor
+
+import android.view.View
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.statusbar.phone.KeyguardBouncer
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.mockito.Mock
+import org.mockito.Mockito.verify
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+@RunWith(JUnit4::class)
+class PrimaryBouncerCallbackInteractorTest : SysuiTestCase() {
+ private val mPrimaryBouncerCallbackInteractor = PrimaryBouncerCallbackInteractor()
+ @Mock
+ private lateinit var mPrimaryBouncerExpansionCallback:
+ KeyguardBouncer.PrimaryBouncerExpansionCallback
+ @Mock private lateinit var keyguardResetCallback: KeyguardBouncer.KeyguardResetCallback
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ mPrimaryBouncerCallbackInteractor.addBouncerExpansionCallback(
+ mPrimaryBouncerExpansionCallback
+ )
+ mPrimaryBouncerCallbackInteractor.addKeyguardResetCallback(keyguardResetCallback)
+ }
+
+ @Test
+ fun testOnFullyShown() {
+ mPrimaryBouncerCallbackInteractor.dispatchFullyShown()
+ verify(mPrimaryBouncerExpansionCallback).onFullyShown()
+ }
+
+ @Test
+ fun testOnFullyHidden() {
+ mPrimaryBouncerCallbackInteractor.dispatchFullyHidden()
+ verify(mPrimaryBouncerExpansionCallback).onFullyHidden()
+ }
+
+ @Test
+ fun testOnExpansionChanged() {
+ mPrimaryBouncerCallbackInteractor.dispatchExpansionChanged(5f)
+ verify(mPrimaryBouncerExpansionCallback).onExpansionChanged(5f)
+ }
+
+ @Test
+ fun testOnVisibilityChanged() {
+ mPrimaryBouncerCallbackInteractor.dispatchVisibilityChanged(View.INVISIBLE)
+ verify(mPrimaryBouncerExpansionCallback).onVisibilityChanged(false)
+ }
+
+ @Test
+ fun testOnStartingToHide() {
+ mPrimaryBouncerCallbackInteractor.dispatchStartingToHide()
+ verify(mPrimaryBouncerExpansionCallback).onStartingToHide()
+ }
+
+ @Test
+ fun testOnStartingToShow() {
+ mPrimaryBouncerCallbackInteractor.dispatchStartingToShow()
+ verify(mPrimaryBouncerExpansionCallback).onStartingToShow()
+ }
+
+ @Test
+ fun testOnKeyguardReset() {
+ mPrimaryBouncerCallbackInteractor.dispatchReset()
+ verify(keyguardResetCallback).onKeyguardReset()
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/BouncerInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt
similarity index 60%
rename from packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/BouncerInteractorTest.kt
rename to packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt
index 5743b2f..c85f7b9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/BouncerInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractorTest.kt
@@ -53,59 +53,59 @@
@SmallTest
@RunWithLooper(setAsMainLooper = true)
@RunWith(AndroidTestingRunner::class)
-class BouncerInteractorTest : SysuiTestCase() {
+class PrimaryBouncerInteractorTest : SysuiTestCase() {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private lateinit var repository: KeyguardBouncerRepository
@Mock(answer = Answers.RETURNS_DEEP_STUBS) private lateinit var bouncerView: BouncerView
@Mock private lateinit var bouncerViewDelegate: BouncerViewDelegate
@Mock private lateinit var keyguardStateController: KeyguardStateController
@Mock private lateinit var keyguardSecurityModel: KeyguardSecurityModel
- @Mock private lateinit var bouncerCallbackInteractor: BouncerCallbackInteractor
+ @Mock private lateinit var mPrimaryBouncerCallbackInteractor: PrimaryBouncerCallbackInteractor
@Mock private lateinit var falsingCollector: FalsingCollector
@Mock private lateinit var dismissCallbackRegistry: DismissCallbackRegistry
@Mock private lateinit var keyguardBypassController: KeyguardBypassController
@Mock private lateinit var keyguardUpdateMonitor: KeyguardUpdateMonitor
private val mainHandler = FakeHandler(Looper.getMainLooper())
- private lateinit var bouncerInteractor: BouncerInteractor
+ private lateinit var mPrimaryBouncerInteractor: PrimaryBouncerInteractor
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
DejankUtils.setImmediate(true)
- bouncerInteractor =
- BouncerInteractor(
+ mPrimaryBouncerInteractor =
+ PrimaryBouncerInteractor(
repository,
bouncerView,
mainHandler,
keyguardStateController,
keyguardSecurityModel,
- bouncerCallbackInteractor,
+ mPrimaryBouncerCallbackInteractor,
falsingCollector,
dismissCallbackRegistry,
keyguardBypassController,
keyguardUpdateMonitor,
)
- `when`(repository.startingDisappearAnimation.value).thenReturn(null)
- `when`(repository.show.value).thenReturn(null)
+ `when`(repository.primaryBouncerStartingDisappearAnimation.value).thenReturn(null)
+ `when`(repository.primaryBouncerShow.value).thenReturn(null)
`when`(bouncerView.delegate).thenReturn(bouncerViewDelegate)
}
@Test
fun testShow_isScrimmed() {
- bouncerInteractor.show(true)
+ mPrimaryBouncerInteractor.show(true)
verify(repository).setShowMessage(null)
verify(repository).setOnScreenTurnedOff(false)
verify(repository).setKeyguardAuthenticated(null)
- verify(repository).setHide(false)
- verify(repository).setStartingToHide(false)
- verify(repository).setScrimmed(true)
+ verify(repository).setPrimaryHide(false)
+ verify(repository).setPrimaryStartingToHide(false)
+ verify(repository).setPrimaryScrimmed(true)
verify(repository).setPanelExpansion(EXPANSION_VISIBLE)
- verify(repository).setShowingSoon(true)
+ verify(repository).setPrimaryShowingSoon(true)
verify(keyguardStateController).notifyBouncerShowing(true)
- verify(bouncerCallbackInteractor).dispatchStartingToShow()
- verify(repository).setVisible(true)
- verify(repository).setShow(any(KeyguardBouncerModel::class.java))
- verify(repository).setShowingSoon(false)
+ verify(mPrimaryBouncerCallbackInteractor).dispatchStartingToShow()
+ verify(repository).setPrimaryVisible(true)
+ verify(repository).setPrimaryShow(any(KeyguardBouncerModel::class.java))
+ verify(repository).setPrimaryShowingSoon(false)
}
@Test
@@ -117,60 +117,60 @@
fun testShow_keyguardIsDone() {
`when`(bouncerView.delegate?.showNextSecurityScreenOrFinish()).thenReturn(true)
verify(keyguardStateController, never()).notifyBouncerShowing(true)
- verify(bouncerCallbackInteractor, never()).dispatchStartingToShow()
+ verify(mPrimaryBouncerCallbackInteractor, never()).dispatchStartingToShow()
}
@Test
fun testHide() {
- bouncerInteractor.hide()
+ mPrimaryBouncerInteractor.hide()
verify(falsingCollector).onBouncerHidden()
verify(keyguardStateController).notifyBouncerShowing(false)
- verify(repository).setShowingSoon(false)
- verify(repository).setVisible(false)
- verify(repository).setHide(true)
- verify(repository).setShow(null)
+ verify(repository).setPrimaryShowingSoon(false)
+ verify(repository).setPrimaryVisible(false)
+ verify(repository).setPrimaryHide(true)
+ verify(repository).setPrimaryShow(null)
}
@Test
fun testExpansion() {
`when`(repository.panelExpansionAmount.value).thenReturn(0.5f)
- bouncerInteractor.setPanelExpansion(0.6f)
+ mPrimaryBouncerInteractor.setPanelExpansion(0.6f)
verify(repository).setPanelExpansion(0.6f)
- verify(bouncerCallbackInteractor).dispatchExpansionChanged(0.6f)
+ verify(mPrimaryBouncerCallbackInteractor).dispatchExpansionChanged(0.6f)
}
@Test
fun testExpansion_fullyShown() {
`when`(repository.panelExpansionAmount.value).thenReturn(0.5f)
- `when`(repository.startingDisappearAnimation.value).thenReturn(null)
- bouncerInteractor.setPanelExpansion(EXPANSION_VISIBLE)
+ `when`(repository.primaryBouncerStartingDisappearAnimation.value).thenReturn(null)
+ mPrimaryBouncerInteractor.setPanelExpansion(EXPANSION_VISIBLE)
verify(falsingCollector).onBouncerShown()
- verify(bouncerCallbackInteractor).dispatchFullyShown()
+ verify(mPrimaryBouncerCallbackInteractor).dispatchFullyShown()
}
@Test
fun testExpansion_fullyHidden() {
`when`(repository.panelExpansionAmount.value).thenReturn(0.5f)
- `when`(repository.startingDisappearAnimation.value).thenReturn(null)
- bouncerInteractor.setPanelExpansion(EXPANSION_HIDDEN)
- verify(repository).setVisible(false)
- verify(repository).setShow(null)
+ `when`(repository.primaryBouncerStartingDisappearAnimation.value).thenReturn(null)
+ mPrimaryBouncerInteractor.setPanelExpansion(EXPANSION_HIDDEN)
+ verify(repository).setPrimaryVisible(false)
+ verify(repository).setPrimaryShow(null)
verify(falsingCollector).onBouncerHidden()
- verify(bouncerCallbackInteractor).dispatchReset()
- verify(bouncerCallbackInteractor).dispatchFullyHidden()
+ verify(mPrimaryBouncerCallbackInteractor).dispatchReset()
+ verify(mPrimaryBouncerCallbackInteractor).dispatchFullyHidden()
}
@Test
fun testExpansion_startingToHide() {
`when`(repository.panelExpansionAmount.value).thenReturn(EXPANSION_VISIBLE)
- bouncerInteractor.setPanelExpansion(0.1f)
- verify(repository).setStartingToHide(true)
- verify(bouncerCallbackInteractor).dispatchStartingToHide()
+ mPrimaryBouncerInteractor.setPanelExpansion(0.1f)
+ verify(repository).setPrimaryStartingToHide(true)
+ verify(mPrimaryBouncerCallbackInteractor).dispatchStartingToHide()
}
@Test
fun testShowMessage() {
- bouncerInteractor.showMessage("abc", null)
+ mPrimaryBouncerInteractor.showMessage("abc", null)
verify(repository).setShowMessage(BouncerShowMessageModel("abc", null))
}
@@ -178,100 +178,100 @@
fun testDismissAction() {
val onDismissAction = mock(ActivityStarter.OnDismissAction::class.java)
val cancelAction = mock(Runnable::class.java)
- bouncerInteractor.setDismissAction(onDismissAction, cancelAction)
+ mPrimaryBouncerInteractor.setDismissAction(onDismissAction, cancelAction)
verify(bouncerViewDelegate).setDismissAction(onDismissAction, cancelAction)
}
@Test
fun testUpdateResources() {
- bouncerInteractor.updateResources()
+ mPrimaryBouncerInteractor.updateResources()
verify(repository).setResourceUpdateRequests(true)
}
@Test
fun testNotifyKeyguardAuthenticated() {
- bouncerInteractor.notifyKeyguardAuthenticated(true)
+ mPrimaryBouncerInteractor.notifyKeyguardAuthenticated(true)
verify(repository).setKeyguardAuthenticated(true)
}
@Test
fun testOnScreenTurnedOff() {
- bouncerInteractor.onScreenTurnedOff()
+ mPrimaryBouncerInteractor.onScreenTurnedOff()
verify(repository).setOnScreenTurnedOff(true)
}
@Test
fun testSetKeyguardPosition() {
- bouncerInteractor.setKeyguardPosition(0f)
+ mPrimaryBouncerInteractor.setKeyguardPosition(0f)
verify(repository).setKeyguardPosition(0f)
}
@Test
fun testNotifyKeyguardAuthenticatedHandled() {
- bouncerInteractor.notifyKeyguardAuthenticatedHandled()
+ mPrimaryBouncerInteractor.notifyKeyguardAuthenticatedHandled()
verify(repository).setKeyguardAuthenticated(null)
}
@Test
fun testNotifyUpdatedResources() {
- bouncerInteractor.notifyUpdatedResources()
+ mPrimaryBouncerInteractor.notifyUpdatedResources()
verify(repository).setResourceUpdateRequests(false)
}
@Test
fun testSetBackButtonEnabled() {
- bouncerInteractor.setBackButtonEnabled(true)
+ mPrimaryBouncerInteractor.setBackButtonEnabled(true)
verify(repository).setIsBackButtonEnabled(true)
}
@Test
fun testStartDisappearAnimation() {
val runnable = mock(Runnable::class.java)
- bouncerInteractor.startDisappearAnimation(runnable)
- verify(repository).setStartDisappearAnimation(any(Runnable::class.java))
+ mPrimaryBouncerInteractor.startDisappearAnimation(runnable)
+ verify(repository).setPrimaryStartDisappearAnimation(any(Runnable::class.java))
}
@Test
fun testIsFullShowing() {
- `when`(repository.isVisible.value).thenReturn(true)
+ `when`(repository.primaryBouncerVisible.value).thenReturn(true)
`when`(repository.panelExpansionAmount.value).thenReturn(EXPANSION_VISIBLE)
- `when`(repository.startingDisappearAnimation.value).thenReturn(null)
- assertThat(bouncerInteractor.isFullyShowing()).isTrue()
- `when`(repository.isVisible.value).thenReturn(false)
- assertThat(bouncerInteractor.isFullyShowing()).isFalse()
+ `when`(repository.primaryBouncerStartingDisappearAnimation.value).thenReturn(null)
+ assertThat(mPrimaryBouncerInteractor.isFullyShowing()).isTrue()
+ `when`(repository.primaryBouncerVisible.value).thenReturn(false)
+ assertThat(mPrimaryBouncerInteractor.isFullyShowing()).isFalse()
}
@Test
fun testIsScrimmed() {
- `when`(repository.isScrimmed.value).thenReturn(true)
- assertThat(bouncerInteractor.isScrimmed()).isTrue()
- `when`(repository.isScrimmed.value).thenReturn(false)
- assertThat(bouncerInteractor.isScrimmed()).isFalse()
+ `when`(repository.primaryBouncerScrimmed.value).thenReturn(true)
+ assertThat(mPrimaryBouncerInteractor.isScrimmed()).isTrue()
+ `when`(repository.primaryBouncerScrimmed.value).thenReturn(false)
+ assertThat(mPrimaryBouncerInteractor.isScrimmed()).isFalse()
}
@Test
fun testIsInTransit() {
- `when`(repository.showingSoon.value).thenReturn(true)
- assertThat(bouncerInteractor.isInTransit()).isTrue()
- `when`(repository.showingSoon.value).thenReturn(false)
- assertThat(bouncerInteractor.isInTransit()).isFalse()
+ `when`(repository.primaryBouncerShowingSoon.value).thenReturn(true)
+ assertThat(mPrimaryBouncerInteractor.isInTransit()).isTrue()
+ `when`(repository.primaryBouncerShowingSoon.value).thenReturn(false)
+ assertThat(mPrimaryBouncerInteractor.isInTransit()).isFalse()
`when`(repository.panelExpansionAmount.value).thenReturn(0.5f)
- assertThat(bouncerInteractor.isInTransit()).isTrue()
+ assertThat(mPrimaryBouncerInteractor.isInTransit()).isTrue()
}
@Test
fun testIsAnimatingAway() {
- `when`(repository.startingDisappearAnimation.value).thenReturn(Runnable {})
- assertThat(bouncerInteractor.isAnimatingAway()).isTrue()
- `when`(repository.startingDisappearAnimation.value).thenReturn(null)
- assertThat(bouncerInteractor.isAnimatingAway()).isFalse()
+ `when`(repository.primaryBouncerStartingDisappearAnimation.value).thenReturn(Runnable {})
+ assertThat(mPrimaryBouncerInteractor.isAnimatingAway()).isTrue()
+ `when`(repository.primaryBouncerStartingDisappearAnimation.value).thenReturn(null)
+ assertThat(mPrimaryBouncerInteractor.isAnimatingAway()).isFalse()
}
@Test
fun testWillDismissWithAction() {
`when`(bouncerViewDelegate.willDismissWithActions()).thenReturn(true)
- assertThat(bouncerInteractor.willDismissWithAction()).isTrue()
+ assertThat(mPrimaryBouncerInteractor.willDismissWithAction()).isTrue()
`when`(bouncerViewDelegate.willDismissWithActions()).thenReturn(false)
- assertThat(bouncerInteractor.willDismissWithAction()).isFalse()
+ assertThat(mPrimaryBouncerInteractor.willDismissWithAction()).isFalse()
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt
index 3c867ab..9f28708 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.kt
@@ -64,7 +64,7 @@
whenever(brightnessSliderFactory.create(any(), any())).thenReturn(brightnessSlider)
whenever(brightnessControllerFactory.create(any())).thenReturn(brightnessController)
whenever(qsPanel.resources).thenReturn(mContext.orCreateTestableResources.resources)
- whenever(statusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(false)
+ whenever(statusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(false)
whenever(qsPanel.setListening(anyBoolean())).then {
whenever(qsPanel.isListening).thenReturn(it.getArgument(0))
}
@@ -116,9 +116,9 @@
@Test
fun testIsBouncerInTransit() {
- whenever(statusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true)
+ whenever(statusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(true)
assertThat(controller.isBouncerInTransit()).isEqualTo(true)
- whenever(statusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(false)
+ whenever(statusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(false)
assertThat(controller.isBouncerInTransit()).isEqualTo(false)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
index c98c1f2..fb2046d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
@@ -854,7 +854,7 @@
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD.getId(),
null);
- verify(mStatusBarKeyguardViewManager).showBouncer(true);
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true);
}
@Test
@@ -864,7 +864,7 @@
AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP.getId(),
null);
- verify(mStatusBarKeyguardViewManager).showBouncer(true);
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java
index a4a7995..a6c80ab6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.java
@@ -152,7 +152,7 @@
// WHEN showing alt auth, not dozing, drag down helper doesn't want to intercept
when(mStatusBarStateController.isDozing()).thenReturn(false);
- when(mStatusBarKeyguardViewManager.isShowingAlternateAuth()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isShowingAlternateBouncer()).thenReturn(true);
when(mDragDownHelper.onInterceptTouchEvent(any())).thenReturn(false);
// THEN we should intercept touch
@@ -165,7 +165,7 @@
// WHEN not showing alt auth, not dozing, drag down helper doesn't want to intercept
when(mStatusBarStateController.isDozing()).thenReturn(false);
- when(mStatusBarKeyguardViewManager.isShowingAlternateAuth()).thenReturn(false);
+ when(mStatusBarKeyguardViewManager.isShowingAlternateBouncer()).thenReturn(false);
when(mDragDownHelper.onInterceptTouchEvent(any())).thenReturn(false);
// THEN we shouldn't intercept touch
@@ -178,7 +178,7 @@
// WHEN showing alt auth, not dozing, drag down helper doesn't want to intercept
when(mStatusBarStateController.isDozing()).thenReturn(false);
- when(mStatusBarKeyguardViewManager.isShowingAlternateAuth()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isShowingAlternateBouncer()).thenReturn(true);
when(mDragDownHelper.onInterceptTouchEvent(any())).thenReturn(false);
// THEN we should handle the touch
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
index 40aec82..743e7d6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
@@ -118,7 +118,7 @@
@Test
fun resetViewStates_expansionChanging_notificationBecomesTransparent() {
- whenever(mStatusBarKeyguardViewManager.isBouncerInTransit).thenReturn(false)
+ whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(false)
resetViewStates_expansionChanging_notificationAlphaUpdated(
expansionFraction = 0.25f,
expectedAlpha = 0.0f
@@ -127,7 +127,7 @@
@Test
fun resetViewStates_expansionChangingWhileBouncerInTransit_viewBecomesTransparent() {
- whenever(mStatusBarKeyguardViewManager.isBouncerInTransit).thenReturn(true)
+ whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(true)
resetViewStates_expansionChanging_notificationAlphaUpdated(
expansionFraction = 0.85f,
expectedAlpha = 0.0f
@@ -136,7 +136,7 @@
@Test
fun resetViewStates_expansionChanging_notificationAlphaUpdated() {
- whenever(mStatusBarKeyguardViewManager.isBouncerInTransit).thenReturn(false)
+ whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(false)
resetViewStates_expansionChanging_notificationAlphaUpdated(
expansionFraction = 0.6f,
expectedAlpha = getContentAlpha(0.6f)
@@ -145,7 +145,7 @@
@Test
fun resetViewStates_expansionChangingWhileBouncerInTransit_notificationAlphaUpdated() {
- whenever(mStatusBarKeyguardViewManager.isBouncerInTransit).thenReturn(true)
+ whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(true)
resetViewStates_expansionChanging_notificationAlphaUpdated(
expansionFraction = 0.95f,
expectedAlpha = aboutToShowBouncerProgress(0.95f)
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 b17747a..75a3b21 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
@@ -147,24 +147,24 @@
}
@Test
- public void onBiometricAuthenticated_whenFingerprintAndBiometricsDisallowed_showBouncer() {
+ public void onBiometricAuthenticated_fingerprintAndBiometricsDisallowed_showPrimaryBouncer() {
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(true /* isStrongBiometric */))
.thenReturn(false);
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */);
- verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean());
verify(mStatusBarKeyguardViewManager, never()).notifyKeyguardAuthenticated(anyBoolean());
assertThat(mBiometricUnlockController.getMode())
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
}
@Test
- public void onBiometricAuthenticated_whenFingerprint_nonStrongBioDisallowed_showBouncer() {
+ public void onBiometricAuthenticated_fingerprint_nonStrongBioDisallowed_showPrimaryBouncer() {
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(false /* isStrongBiometric */))
.thenReturn(false);
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
BiometricSourceType.FINGERPRINT, false /* isStrongBiometric */);
- verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean());
assertThat(mBiometricUnlockController.getMode())
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
assertThat(mBiometricUnlockController.getBiometricType())
@@ -214,7 +214,7 @@
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */);
- verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean());
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
assertThat(mBiometricUnlockController.getMode())
.isEqualTo(BiometricUnlockController.MODE_UNLOCK_COLLAPSING);
@@ -223,7 +223,7 @@
@Test
public void onBiometricAuthenticated_whenFingerprintOnBouncer_dismissBouncer() {
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
- when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing()).thenReturn(true);
// the value of isStrongBiometric doesn't matter here since we only care about the returned
// value of isUnlockingWithBiometricAllowed()
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
@@ -283,7 +283,7 @@
}
@Test
- public void onBiometricAuthenticated_whenFace_andBypass_encrypted_showBouncer() {
+ public void onBiometricAuthenticated_whenFace_andBypass_encrypted_showPrimaryBouncer() {
reset(mUpdateMonitor);
when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true);
mBiometricUnlockController.setKeyguardViewController(mStatusBarKeyguardViewManager);
@@ -294,7 +294,7 @@
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
BiometricSourceType.FACE, true /* isStrongBiometric */);
- verify(mStatusBarKeyguardViewManager).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean());
assertThat(mBiometricUnlockController.getMode())
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
}
@@ -330,7 +330,7 @@
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
BiometricSourceType.FACE, true /* isStrongBiometric */);
- verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean());
verify(mShadeController, never()).animateCollapsePanels(anyInt(), anyBoolean(),
anyBoolean(), anyFloat());
assertThat(mBiometricUnlockController.getMode())
@@ -340,7 +340,7 @@
@Test
public void onBiometricAuthenticated_whenFaceOnBouncer_dismissBouncer() {
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
- when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing()).thenReturn(true);
// the value of isStrongBiometric doesn't matter here since we only care about the returned
// value of isUnlockingWithBiometricAllowed()
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
@@ -360,7 +360,7 @@
when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true);
when(mKeyguardBypassController.onBiometricAuthenticated(any(), anyBoolean()))
.thenReturn(true);
- when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing()).thenReturn(true);
// the value of isStrongBiometric doesn't matter here since we only care about the returned
// value of isUnlockingWithBiometricAllowed()
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
@@ -389,23 +389,23 @@
}
@Test
- public void onUdfpsConsecutivelyFailedThreeTimes_showBouncer() {
+ public void onUdfpsConsecutivelyFailedThreeTimes_showPrimaryBouncer() {
// GIVEN UDFPS is supported
when(mUpdateMonitor.isUdfpsSupported()).thenReturn(true);
// WHEN udfps fails once - then don't show the bouncer yet
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
- verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean());
// WHEN udfps fails the second time - then don't show the bouncer yet
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
- verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean());
+ verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean());
// WHEN udpfs fails the third time
mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT);
// THEN show the bouncer
- verify(mStatusBarKeyguardViewManager).showBouncer(true);
+ verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
index ab209d1..d3b5418 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java
@@ -58,7 +58,7 @@
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.keyguard.DismissCallbackRegistry;
import com.android.systemui.plugins.ActivityStarter.OnDismissAction;
-import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback;
+import com.android.systemui.statusbar.phone.KeyguardBouncer.PrimaryBouncerExpansionCallback;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import org.junit.Assert;
@@ -86,7 +86,7 @@
@Mock
private KeyguardHostViewController mKeyguardHostViewController;
@Mock
- private BouncerExpansionCallback mExpansionCallback;
+ private KeyguardBouncer.PrimaryBouncerExpansionCallback mExpansionCallback;
@Mock
private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
@Mock
@@ -476,7 +476,8 @@
mBouncer.ensureView();
mBouncer.setExpansion(0.5f);
- final BouncerExpansionCallback callback = mock(BouncerExpansionCallback.class);
+ final PrimaryBouncerExpansionCallback callback =
+ mock(PrimaryBouncerExpansionCallback.class);
mBouncer.addBouncerExpansionCallback(callback);
mBouncer.setExpansion(EXPANSION_HIDDEN);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index 696775a..df48e1d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -1308,7 +1308,7 @@
@Test
public void qsExpansion_BehindTint_shadeLocked_bouncerActive_usesBouncerProgress() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(true);
// clipping doesn't change tested logic but allows to assert scrims more in line with
// their expected large screen behaviour
mScrimController.setClipsQsScrim(false);
@@ -1324,7 +1324,7 @@
@Test
public void expansionNotificationAlpha_shadeLocked_bouncerActive_usesBouncerInterpolator() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(true);
mScrimController.transitionTo(SHADE_LOCKED);
@@ -1340,7 +1340,7 @@
@Test
public void expansionNotificationAlpha_shadeLocked_bouncerNotActive_usesShadeInterpolator() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(false);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(false);
mScrimController.transitionTo(SHADE_LOCKED);
@@ -1355,7 +1355,7 @@
@Test
public void notificationAlpha_unnocclusionAnimating_bouncerActive_usesKeyguardNotifAlpha() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(true);
mScrimController.setClipsQsScrim(true);
mScrimController.transitionTo(ScrimState.KEYGUARD);
@@ -1377,7 +1377,7 @@
@Test
public void notificationAlpha_unnocclusionAnimating_bouncerNotActive_usesKeyguardNotifAlpha() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(false);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(false);
mScrimController.transitionTo(ScrimState.KEYGUARD);
mScrimController.setUnocclusionAnimationRunning(true);
@@ -1398,7 +1398,7 @@
@Test
public void notificationAlpha_inKeyguardState_bouncerActive_usesInvertedBouncerInterpolator() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(true);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(true);
mScrimController.setClipsQsScrim(true);
mScrimController.transitionTo(ScrimState.KEYGUARD);
@@ -1418,7 +1418,7 @@
@Test
public void notificationAlpha_inKeyguardState_bouncerNotActive_usesInvertedShadeInterpolator() {
- when(mStatusBarKeyguardViewManager.isBouncerInTransit()).thenReturn(false);
+ when(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).thenReturn(false);
mScrimController.setClipsQsScrim(true);
mScrimController.transitionTo(ScrimState.KEYGUARD);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
index ec8d711..49c3a21 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
@@ -56,8 +56,8 @@
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.keyguard.data.BouncerView;
import com.android.systemui.keyguard.data.BouncerViewDelegate;
-import com.android.systemui.keyguard.domain.interactor.BouncerCallbackInteractor;
-import com.android.systemui.keyguard.domain.interactor.BouncerInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerCallbackInteractor;
+import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.plugins.ActivityStarter.OnDismissAction;
import com.android.systemui.shade.NotificationPanelViewController;
@@ -105,8 +105,8 @@
@Mock private KeyguardBouncer.Factory mKeyguardBouncerFactory;
@Mock private KeyguardMessageAreaController.Factory mKeyguardMessageAreaFactory;
@Mock private KeyguardMessageAreaController mKeyguardMessageAreaController;
- @Mock private KeyguardBouncer mBouncer;
- @Mock private StatusBarKeyguardViewManager.AlternateAuthInterceptor mAlternateAuthInterceptor;
+ @Mock private KeyguardBouncer mPrimaryBouncer;
+ @Mock private StatusBarKeyguardViewManager.AlternateBouncer mAlternateBouncer;
@Mock private KeyguardMessageArea mKeyguardMessageArea;
@Mock private ShadeController mShadeController;
@Mock private SysUIUnfoldComponent mSysUiUnfoldComponent;
@@ -114,13 +114,13 @@
@Mock private LatencyTracker mLatencyTracker;
@Mock private FeatureFlags mFeatureFlags;
@Mock private KeyguardSecurityModel mKeyguardSecurityModel;
- @Mock private BouncerCallbackInteractor mBouncerCallbackInteractor;
- @Mock private BouncerInteractor mBouncerInteractor;
+ @Mock private PrimaryBouncerCallbackInteractor mPrimaryBouncerCallbackInteractor;
+ @Mock private PrimaryBouncerInteractor mPrimaryBouncerInteractor;
@Mock private BouncerView mBouncerView;
@Mock private BouncerViewDelegate mBouncerViewDelegate;
private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
- private KeyguardBouncer.BouncerExpansionCallback mBouncerExpansionCallback;
+ private KeyguardBouncer.PrimaryBouncerExpansionCallback mBouncerExpansionCallback;
private FakeKeyguardStateController mKeyguardStateController =
spy(new FakeKeyguardStateController());
@@ -134,8 +134,9 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mKeyguardBouncerFactory.create(
- any(ViewGroup.class), any(KeyguardBouncer.BouncerExpansionCallback.class)))
- .thenReturn(mBouncer);
+ any(ViewGroup.class),
+ any(KeyguardBouncer.PrimaryBouncerExpansionCallback.class)))
+ .thenReturn(mPrimaryBouncer);
when(mCentralSurfaces.getBouncerContainer()).thenReturn(mContainer);
when(mContainer.findViewById(anyInt())).thenReturn(mKeyguardMessageArea);
when(mKeyguardMessageAreaFactory.create(any(KeyguardMessageArea.class)))
@@ -163,8 +164,8 @@
mLatencyTracker,
mKeyguardSecurityModel,
mFeatureFlags,
- mBouncerCallbackInteractor,
- mBouncerInteractor,
+ mPrimaryBouncerCallbackInteractor,
+ mPrimaryBouncerInteractor,
mBouncerView) {
@Override
public ViewRootImpl getViewRootImpl() {
@@ -181,8 +182,8 @@
mNotificationContainer,
mBypassController);
mStatusBarKeyguardViewManager.show(null);
- ArgumentCaptor<KeyguardBouncer.BouncerExpansionCallback> callbackArgumentCaptor =
- ArgumentCaptor.forClass(KeyguardBouncer.BouncerExpansionCallback.class);
+ ArgumentCaptor<KeyguardBouncer.PrimaryBouncerExpansionCallback> callbackArgumentCaptor =
+ ArgumentCaptor.forClass(KeyguardBouncer.PrimaryBouncerExpansionCallback.class);
verify(mKeyguardBouncerFactory).create(any(ViewGroup.class),
callbackArgumentCaptor.capture());
mBouncerExpansionCallback = callbackArgumentCaptor.getValue();
@@ -194,86 +195,86 @@
Runnable cancelAction = () -> {};
mStatusBarKeyguardViewManager.dismissWithAction(
action, cancelAction, false /* afterKeyguardGone */);
- verify(mBouncer).showWithDismissAction(eq(action), eq(cancelAction));
+ verify(mPrimaryBouncer).showWithDismissAction(eq(action), eq(cancelAction));
}
@Test
public void showBouncer_onlyWhenShowing() {
mStatusBarKeyguardViewManager.hide(0 /* startTime */, 0 /* fadeoutDuration */);
- mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
- verify(mBouncer, never()).show(anyBoolean(), anyBoolean());
- verify(mBouncer, never()).show(anyBoolean());
+ mStatusBarKeyguardViewManager.showPrimaryBouncer(true /* scrimmed */);
+ verify(mPrimaryBouncer, never()).show(anyBoolean(), anyBoolean());
+ verify(mPrimaryBouncer, never()).show(anyBoolean());
}
@Test
public void showBouncer_notWhenBouncerAlreadyShowing() {
mStatusBarKeyguardViewManager.hide(0 /* startTime */, 0 /* fadeoutDuration */);
- when(mBouncer.isSecure()).thenReturn(true);
- mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
- verify(mBouncer, never()).show(anyBoolean(), anyBoolean());
- verify(mBouncer, never()).show(anyBoolean());
+ when(mPrimaryBouncer.isSecure()).thenReturn(true);
+ mStatusBarKeyguardViewManager.showPrimaryBouncer(true /* scrimmed */);
+ verify(mPrimaryBouncer, never()).show(anyBoolean(), anyBoolean());
+ verify(mPrimaryBouncer, never()).show(anyBoolean());
}
@Test
public void showBouncer_showsTheBouncer() {
- mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
- verify(mBouncer).show(anyBoolean(), eq(true));
+ mStatusBarKeyguardViewManager.showPrimaryBouncer(true /* scrimmed */);
+ verify(mPrimaryBouncer).show(anyBoolean(), eq(true));
}
@Test
public void onPanelExpansionChanged_neverHidesScrimmedBouncer() {
- when(mBouncer.isShowing()).thenReturn(true);
- when(mBouncer.isScrimmed()).thenReturn(true);
+ when(mPrimaryBouncer.isShowing()).thenReturn(true);
+ when(mPrimaryBouncer.isScrimmed()).thenReturn(true);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer).setExpansion(eq(KeyguardBouncer.EXPANSION_VISIBLE));
+ verify(mPrimaryBouncer).setExpansion(eq(KeyguardBouncer.EXPANSION_VISIBLE));
}
@Test
public void onPanelExpansionChanged_neverShowsDuringHintAnimation() {
when(mNotificationPanelView.isUnlockHintRunning()).thenReturn(true);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer).setExpansion(eq(KeyguardBouncer.EXPANSION_HIDDEN));
+ verify(mPrimaryBouncer).setExpansion(eq(KeyguardBouncer.EXPANSION_HIDDEN));
}
@Test
public void onPanelExpansionChanged_propagatesToBouncer() {
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer).setExpansion(eq(0.5f));
+ verify(mPrimaryBouncer).setExpansion(eq(0.5f));
}
@Test
public void onPanelExpansionChanged_hideBouncer_afterKeyguardHidden() {
mStatusBarKeyguardViewManager.hide(0, 0);
- when(mBouncer.inTransit()).thenReturn(true);
+ when(mPrimaryBouncer.inTransit()).thenReturn(true);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer).setExpansion(eq(KeyguardBouncer.EXPANSION_HIDDEN));
+ verify(mPrimaryBouncer).setExpansion(eq(KeyguardBouncer.EXPANSION_HIDDEN));
}
@Test
public void onPanelExpansionChanged_showsBouncerWhenSwiping() {
mKeyguardStateController.setCanDismissLockScreen(false);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer).show(eq(false), eq(false));
+ verify(mPrimaryBouncer).show(eq(false), eq(false));
// But not when it's already visible
- reset(mBouncer);
- when(mBouncer.isShowing()).thenReturn(true);
+ reset(mPrimaryBouncer);
+ when(mPrimaryBouncer.isShowing()).thenReturn(true);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer, never()).show(eq(false), eq(false));
+ verify(mPrimaryBouncer, never()).show(eq(false), eq(false));
// Or animating away
- reset(mBouncer);
- when(mBouncer.isAnimatingAway()).thenReturn(true);
+ reset(mPrimaryBouncer);
+ when(mPrimaryBouncer.isAnimatingAway()).thenReturn(true);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer, never()).show(eq(false), eq(false));
+ verify(mPrimaryBouncer, never()).show(eq(false), eq(false));
}
@Test
public void onPanelExpansionChanged_neverTranslatesBouncerWhenOccluded() {
mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animate */);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(EXPANSION_EVENT);
- verify(mBouncer, never()).setExpansion(eq(0.5f));
+ verify(mPrimaryBouncer, never()).setExpansion(eq(0.5f));
}
@Test
@@ -285,7 +286,7 @@
/* fraction= */ KeyguardBouncer.EXPANSION_VISIBLE,
/* expanded= */ true,
/* tracking= */ false));
- verify(mBouncer, never()).setExpansion(anyFloat());
+ verify(mPrimaryBouncer, never()).setExpansion(anyFloat());
}
@Test
@@ -302,7 +303,7 @@
/* fraction= */ KeyguardBouncer.EXPANSION_VISIBLE,
/* expanded= */ true,
/* tracking= */ false));
- verify(mBouncer, never()).setExpansion(anyFloat());
+ verify(mPrimaryBouncer, never()).setExpansion(anyFloat());
}
@Test
@@ -313,7 +314,7 @@
/* fraction= */ KeyguardBouncer.EXPANSION_VISIBLE,
/* expanded= */ true,
/* tracking= */ false));
- verify(mBouncer, never()).setExpansion(anyFloat());
+ verify(mPrimaryBouncer, never()).setExpansion(anyFloat());
}
@Test
@@ -321,7 +322,7 @@
mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, true /* animated */);
verify(mCentralSurfaces).animateKeyguardUnoccluding();
- when(mBouncer.isShowing()).thenReturn(true);
+ when(mPrimaryBouncer.isShowing()).thenReturn(true);
clearInvocations(mCentralSurfaces);
mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, true /* animated */);
verify(mCentralSurfaces, never()).animateKeyguardUnoccluding();
@@ -372,7 +373,7 @@
mStatusBarKeyguardViewManager.dismissWithAction(
action, cancelAction, true /* afterKeyguardGone */);
- when(mBouncer.isShowing()).thenReturn(false);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
mStatusBarKeyguardViewManager.hideBouncer(true);
mStatusBarKeyguardViewManager.hide(0, 30);
verify(action, never()).onDismiss();
@@ -386,7 +387,7 @@
mStatusBarKeyguardViewManager.dismissWithAction(
action, cancelAction, true /* afterKeyguardGone */);
- when(mBouncer.isShowing()).thenReturn(false);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
mStatusBarKeyguardViewManager.hideBouncer(true);
verify(action, never()).onDismiss();
@@ -407,9 +408,9 @@
@Test
public void testShowing_whenAlternateAuthShowing() {
- mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
- when(mBouncer.isShowing()).thenReturn(false);
- when(mAlternateAuthInterceptor.isShowingAlternateAuthBouncer()).thenReturn(true);
+ mStatusBarKeyguardViewManager.setAlternateBouncer(mAlternateBouncer);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
+ when(mAlternateBouncer.isShowingAlternateBouncer()).thenReturn(true);
assertTrue(
"Is showing not accurate when alternative auth showing",
mStatusBarKeyguardViewManager.isBouncerShowing());
@@ -417,93 +418,93 @@
@Test
public void testWillBeShowing_whenAlternateAuthShowing() {
- mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
- when(mBouncer.isShowing()).thenReturn(false);
- when(mAlternateAuthInterceptor.isShowingAlternateAuthBouncer()).thenReturn(true);
+ mStatusBarKeyguardViewManager.setAlternateBouncer(mAlternateBouncer);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
+ when(mAlternateBouncer.isShowingAlternateBouncer()).thenReturn(true);
assertTrue(
"Is or will be showing not accurate when alternative auth showing",
- mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing());
+ mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing());
}
@Test
- public void testHideAltAuth_onShowBouncer() {
+ public void testHideAlternateBouncer_onShowBouncer() {
// GIVEN alt auth is showing
- mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
- when(mBouncer.isShowing()).thenReturn(false);
- when(mAlternateAuthInterceptor.isShowingAlternateAuthBouncer()).thenReturn(true);
- reset(mAlternateAuthInterceptor);
+ mStatusBarKeyguardViewManager.setAlternateBouncer(mAlternateBouncer);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
+ when(mAlternateBouncer.isShowingAlternateBouncer()).thenReturn(true);
+ reset(mAlternateBouncer);
// WHEN showBouncer is called
- mStatusBarKeyguardViewManager.showBouncer(true);
+ mStatusBarKeyguardViewManager.showPrimaryBouncer(true);
// THEN alt bouncer should be hidden
- verify(mAlternateAuthInterceptor).hideAlternateAuthBouncer();
+ verify(mAlternateBouncer).hideAlternateBouncer();
}
@Test
public void testBouncerIsOrWillBeShowing_whenBouncerIsInTransit() {
- when(mBouncer.isShowing()).thenReturn(false);
- when(mBouncer.inTransit()).thenReturn(true);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
+ when(mPrimaryBouncer.inTransit()).thenReturn(true);
assertTrue(
"Is or will be showing should be true when bouncer is in transit",
- mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing());
+ mStatusBarKeyguardViewManager.primaryBouncerIsOrWillBeShowing());
}
@Test
public void testShowAltAuth_unlockingWithBiometricNotAllowed() {
// GIVEN alt auth exists, unlocking with biometric isn't allowed
- mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
- when(mBouncer.isShowing()).thenReturn(false);
+ mStatusBarKeyguardViewManager.setAlternateBouncer(mAlternateBouncer);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
when(mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean()))
.thenReturn(false);
// WHEN showGenericBouncer is called
final boolean scrimmed = true;
- mStatusBarKeyguardViewManager.showGenericBouncer(scrimmed);
+ mStatusBarKeyguardViewManager.showBouncer(scrimmed);
// THEN regular bouncer is shown
- verify(mBouncer).show(anyBoolean(), eq(scrimmed));
- verify(mAlternateAuthInterceptor, never()).showAlternateAuthBouncer();
+ verify(mPrimaryBouncer).show(anyBoolean(), eq(scrimmed));
+ verify(mAlternateBouncer, never()).showAlternateBouncer();
}
@Test
- public void testShowAltAuth_unlockingWithBiometricAllowed() {
+ public void testShowAlternateBouncer_unlockingWithBiometricAllowed() {
// GIVEN alt auth exists, unlocking with biometric is allowed
- mStatusBarKeyguardViewManager.setAlternateAuthInterceptor(mAlternateAuthInterceptor);
- when(mBouncer.isShowing()).thenReturn(false);
+ mStatusBarKeyguardViewManager.setAlternateBouncer(mAlternateBouncer);
+ when(mPrimaryBouncer.isShowing()).thenReturn(false);
when(mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
// WHEN showGenericBouncer is called
- mStatusBarKeyguardViewManager.showGenericBouncer(true);
+ mStatusBarKeyguardViewManager.showBouncer(true);
// THEN alt auth bouncer is shown
- verify(mAlternateAuthInterceptor).showAlternateAuthBouncer();
- verify(mBouncer, never()).show(anyBoolean(), anyBoolean());
+ verify(mAlternateBouncer).showAlternateBouncer();
+ verify(mPrimaryBouncer, never()).show(anyBoolean(), anyBoolean());
}
@Test
public void testUpdateResources_delegatesToBouncer() {
mStatusBarKeyguardViewManager.updateResources();
- verify(mBouncer).updateResources();
+ verify(mPrimaryBouncer).updateResources();
}
@Test
public void updateKeyguardPosition_delegatesToBouncer() {
mStatusBarKeyguardViewManager.updateKeyguardPosition(1.0f);
- verify(mBouncer).updateKeyguardPosition(1.0f);
+ verify(mPrimaryBouncer).updateKeyguardPosition(1.0f);
}
@Test
public void testIsBouncerInTransit() {
- when(mBouncer.inTransit()).thenReturn(true);
- Truth.assertThat(mStatusBarKeyguardViewManager.isBouncerInTransit()).isTrue();
- when(mBouncer.inTransit()).thenReturn(false);
- Truth.assertThat(mStatusBarKeyguardViewManager.isBouncerInTransit()).isFalse();
- mBouncer = null;
- Truth.assertThat(mStatusBarKeyguardViewManager.isBouncerInTransit()).isFalse();
+ when(mPrimaryBouncer.inTransit()).thenReturn(true);
+ Truth.assertThat(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).isTrue();
+ when(mPrimaryBouncer.inTransit()).thenReturn(false);
+ Truth.assertThat(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).isFalse();
+ mPrimaryBouncer = null;
+ Truth.assertThat(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit()).isFalse();
}
private static ShadeExpansionChangeEvent expansionEvent(
@@ -534,7 +535,7 @@
eq(OnBackInvokedDispatcher.PRIORITY_OVERLAY),
mOnBackInvokedCallback.capture());
- when(mBouncer.isShowing()).thenReturn(true);
+ when(mPrimaryBouncer.isShowing()).thenReturn(true);
when(mCentralSurfaces.shouldKeyguardHideImmediately()).thenReturn(true);
/* invoke the back callback directly */
mOnBackInvokedCallback.getValue().onBackInvoked();
@@ -567,6 +568,6 @@
public void flag_off_DoesNotCallBouncerInteractor() {
when(mFeatureFlags.isEnabled(MODERN_BOUNCER)).thenReturn(false);
mStatusBarKeyguardViewManager.hideBouncer(false);
- verify(mBouncerInteractor, never()).hide();
+ verify(mPrimaryBouncerInteractor, never()).hide();
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java
index c3a7e65..613238f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java
@@ -99,6 +99,6 @@
mRemoteInputCallback.onLockedRemoteInput(
mock(ExpandableNotificationRow.class), mock(View.class));
- verify(mStatusBarKeyguardViewManager).showGenericBouncer(true);
+ verify(mStatusBarKeyguardViewManager).showBouncer(true);
}
}
\ No newline at end of file