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

Commit e5040c84 authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Don't hide the bouncer when resetting keyguard if keyguard is already showing." into udc-dev

parents c1b615d8 85d33ae9
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -1957,11 +1957,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        if (mShowing && mKeyguardStateController.isShowing()) {
            if (mPM.isInteractive() && !mHiding) {
                // It's already showing, and we're not trying to show it while the screen is off.
                // We can simply reset all of the views.
                // We can simply reset all of the views, but don't hide the bouncer in case the user
                // is currently interacting with it.
                if (DEBUG) Log.d(TAG, "doKeyguard: not showing (instead, resetting) because it is "
                        + "already showing, we're interactive, and we were not previously hiding. "
                        + "It should be safe to short-circuit here.");
                resetStateLocked();
                resetStateLocked(/* hideBouncer= */ false);
                return;
            } else {
                // We are trying to show the keyguard while the screen is off or while we were in
@@ -2035,8 +2036,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
     * @see #handleReset
     */
    private void resetStateLocked() {
        resetStateLocked(/* hideBouncer= */ true);
    }

    private void resetStateLocked(boolean hideBouncer) {
        if (DEBUG) Log.e(TAG, "resetStateLocked");
        Message msg = mHandler.obtainMessage(RESET);
        Message msg = mHandler.obtainMessage(RESET, hideBouncer ? 1 : 0, 0);
        mHandler.sendMessage(msg);
    }

@@ -2226,7 +2231,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                    handleHide();
                    break;
                case RESET:
                    handleReset();
                    handleReset(msg.arg1 != 0);
                    break;
                case VERIFY_UNLOCK:
                    Trace.beginSection("KeyguardViewMediator#handleMessage VERIFY_UNLOCK");
@@ -3008,10 +3013,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
     * Handle message sent by {@link #resetStateLocked}
     * @see #RESET
     */
    private void handleReset() {
    private void handleReset(boolean hideBouncer) {
        synchronized (KeyguardViewMediator.this) {
            if (DEBUG) Log.d(TAG, "handleReset");
            mKeyguardViewControllerLazy.get().reset(true /* hideBouncerWhenShowing */);
            mKeyguardViewControllerLazy.get().reset(hideBouncer);
        }

        scheduleNonStrongBiometricIdleTimeout();
+1 −1
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        TestableLooper.get(this).processAllMessages();

        assertTrue(mViewMediator.isShowingAndNotOccluded());
        verify(mStatusBarKeyguardViewManager).reset(anyBoolean());
        verify(mStatusBarKeyguardViewManager).reset(false);
    }

    @Test