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

Commit 2581c828 authored by Aaron Liu's avatar Aaron Liu Committed by Automerger Merge Worker
Browse files

Merge "[Bouncer] reset bouncer visibility with doze state." into tm-qpr-dev am: e403afd1

parents e1f28247 e403afd1
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -667,9 +667,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    private void setDozing(boolean dozing) {
        if (mDozing != dozing) {
            mDozing = dozing;
            if (dozing || mBouncer.needsFullscreenBouncer() || mOccluded) {
                reset(dozing /* hideBouncerWhenShowing */);
            }
            reset(true /* hideBouncerWhenShowing */);
            updateStates();

            if (!dozing) {
+18 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static org.mockito.Mockito.clearInvocations;
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;

@@ -505,4 +506,21 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        mBouncerExpansionCallback.onVisibilityChanged(false);
        verify(mCentralSurfaces).setBouncerShowingOverDream(false);
    }

    @Test
    public void testSetDozing_Dozing() {
        clearInvocations(mBouncer);
        mStatusBarKeyguardViewManager.onDozingChanged(true);
        // Once when shown and once with dozing changed.
        verify(mBouncer, times(1)).hide(false);
    }

    @Test
    public void testSetDozing_notDozing() {
        mStatusBarKeyguardViewManager.onDozingChanged(true);
        clearInvocations(mBouncer);
        mStatusBarKeyguardViewManager.onDozingChanged(false);
        // Once when shown and twice with dozing changed.
        verify(mBouncer, times(1)).hide(false);
    }
}