Merge "MODE_SHOW_BOUNCER - Make sure bouncer shows" into tm-qpr-dev

This commit is contained in:
Matt Pietal
2022-11-18 12:26:01 +00:00
committed by Android (Google) Code Review
3 changed files with 28 additions and 0 deletions

View File

@@ -762,6 +762,15 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
return mHasScreenTurnedOnSinceAuthenticating;
}
@Override
public void onKeyguardBouncerStateChanged(boolean bouncerIsOrWillBeShowing) {
// When the bouncer is dismissed, treat this as a reset of the unlock mode. The user
// may have gone back instead of successfully unlocking
if (!bouncerIsOrWillBeShowing) {
resetMode();
}
}
@Override
public void dump(PrintWriter pw, String[] args) {
pw.println(" BiometricUnlockController:");

View File

@@ -20,6 +20,7 @@ import static android.view.WindowInsets.Type.navigationBars;
import static com.android.systemui.plugins.ActivityStarter.OnDismissAction;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_DISMISS_BOUNCER;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_SHOW_BOUNCER;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_UNLOCK_COLLAPSING;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING;
@@ -478,6 +479,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
} else if (mKeyguardStateController.isShowing() && !hideBouncerOverDream) {
if (!isWakeAndUnlocking()
&& !(mBiometricUnlockController.getMode() == MODE_DISMISS_BOUNCER)
&& !(mBiometricUnlockController.getMode() == MODE_SHOW_BOUNCER)
&& !isUnlockCollapsing()) {
if (mPrimaryBouncer != null) {
mPrimaryBouncer.setExpansion(fraction);

View File

@@ -306,6 +306,23 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
verify(mPrimaryBouncer, never()).setExpansion(anyFloat());
}
@Test
public void onPanelExpansionChanged_neverTranslatesBouncerWhenShowBouncer() {
// Since KeyguardBouncer.EXPANSION_VISIBLE = 0 panel expansion, if the unlock is dismissing
// the bouncer, there may be an onPanelExpansionChanged(0) call to collapse the panel
// which would mistakenly cause the bouncer to show briefly before its visibility
// is set to hide. Therefore, we don't want to propagate panelExpansionChanged to the
// bouncer if the bouncer is dismissing as a result of a biometric unlock.
when(mBiometricUnlockController.getMode())
.thenReturn(BiometricUnlockController.MODE_SHOW_BOUNCER);
mStatusBarKeyguardViewManager.onPanelExpansionChanged(
expansionEvent(
/* fraction= */ KeyguardBouncer.EXPANSION_VISIBLE,
/* expanded= */ true,
/* tracking= */ false));
verify(mPrimaryBouncer, never()).setExpansion(anyFloat());
}
@Test
public void onPanelExpansionChanged_neverTranslatesBouncerWhenShadeLocked() {
when(mStatusBarStateController.getState()).thenReturn(StatusBarState.SHADE_LOCKED);