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

Commit 3876db9e authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

Merge "Revert "[Bouncer] ensure bouncer not shown with doze state."" into...

Merge "Revert "[Bouncer] ensure bouncer not shown with doze state."" into tm-qpr-dev am: deb15793 am: 20255cb6

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



Change-Id: Ia8b665fe740fe977f4659f9d93187a175ce36f67
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 8fc76795 20255cb6
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -735,11 +735,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
            if (dozing || mBouncer.needsFullscreenBouncer() || mOccluded) {
                reset(dozing /* hideBouncerWhenShowing */);
            }

            if (bouncerIsOrWillBeShowing()) {
                // Ensure bouncer is not shown when dozing state changes.
                hideBouncer(false);
            }
            updateStates();

            if (!dozing) {
+0 −24
Original line number Diff line number Diff line
@@ -23,11 +23,9 @@ import static org.mockito.ArgumentMatchers.anyFloat;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@@ -527,26 +525,4 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        mBouncerExpansionCallback.onVisibilityChanged(false);
        verify(mCentralSurfaces).setBouncerShowingOverDream(false);
    }


    @Test
    public void testSetDozing_bouncerShowing_Dozing() {
        clearInvocations(mBouncer);
        when(mBouncer.isShowing()).thenReturn(true);
        doAnswer(invocation -> {
            when(mBouncer.isShowing()).thenReturn(false);
            return null;
        }).when(mBouncer).hide(false);
        mStatusBarKeyguardViewManager.onDozingChanged(true);
        verify(mBouncer, times(1)).hide(false);
    }

    @Test
    public void testSetDozing_bouncerShowing_notDozing() {
        mStatusBarKeyguardViewManager.onDozingChanged(true);
        when(mBouncer.isShowing()).thenReturn(true);
        clearInvocations(mBouncer);
        mStatusBarKeyguardViewManager.onDozingChanged(false);
        verify(mBouncer, times(1)).hide(false);
    }
}