Merge "MODE_SHOW_BOUNCER - Make sure bouncer shows" into tm-qpr-dev am: 280d2b8762

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20509108

Change-Id: I187c796afe732d94011d4f61d2f9f9c3a5fb642b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Matt Pietal
2022-11-18 12:34:49 +00:00
committed by Automerger Merge Worker
3 changed files with 28 additions and 0 deletions

View File

@@ -762,6 +762,15 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
return mHasScreenTurnedOnSinceAuthenticating; 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 @Override
public void dump(PrintWriter pw, String[] args) { public void dump(PrintWriter pw, String[] args) {
pw.println(" BiometricUnlockController:"); 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.plugins.ActivityStarter.OnDismissAction;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_DISMISS_BOUNCER; 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_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;
import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING; 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) { } else if (mKeyguardStateController.isShowing() && !hideBouncerOverDream) {
if (!isWakeAndUnlocking() if (!isWakeAndUnlocking()
&& !(mBiometricUnlockController.getMode() == MODE_DISMISS_BOUNCER) && !(mBiometricUnlockController.getMode() == MODE_DISMISS_BOUNCER)
&& !(mBiometricUnlockController.getMode() == MODE_SHOW_BOUNCER)
&& !isUnlockCollapsing()) { && !isUnlockCollapsing()) {
if (mPrimaryBouncer != null) { if (mPrimaryBouncer != null) {
mPrimaryBouncer.setExpansion(fraction); mPrimaryBouncer.setExpansion(fraction);

View File

@@ -306,6 +306,23 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
verify(mPrimaryBouncer, never()).setExpansion(anyFloat()); 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 @Test
public void onPanelExpansionChanged_neverTranslatesBouncerWhenShadeLocked() { public void onPanelExpansionChanged_neverTranslatesBouncerWhenShadeLocked() {
when(mStatusBarStateController.getState()).thenReturn(StatusBarState.SHADE_LOCKED); when(mStatusBarStateController.getState()).thenReturn(StatusBarState.SHADE_LOCKED);