Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 280d2b87 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

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

parents 2850e330 7afd3eeb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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:");
+2 −0
Original line number Diff line number Diff line
@@ -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);
+17 −0
Original line number Diff line number Diff line
@@ -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);