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

Commit ae24ed69 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "On occlusion: use AUTH_SCRIMMED scrim state" into tm-qpr-dev am: 64d3a0e6 am: e42f12f2

parents 06b1a38e e42f12f2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3798,10 +3798,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {

        boolean launchingAffordanceWithPreview = mLaunchingAffordance;
        mScrimController.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);

        if (mAlternateBouncerInteractor.isVisibleState()) {
            if (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED
                    || mTransitionToFullShadeProgress > 0f) {
            if ((!isOccluded() || isPanelExpanded())
                    && (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED
                    || mTransitionToFullShadeProgress > 0f)) {
                mScrimController.transitionTo(ScrimState.AUTH_SCRIMMED_SHADE);
            } else {
                mScrimController.transitionTo(ScrimState.AUTH_SCRIMMED);
+28 −0
Original line number Diff line number Diff line
@@ -1090,6 +1090,34 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
        verify(mStatusBarKeyguardViewManager).onKeyguardFadedAway();
    }

    @Test
    public void testOccludingQSNotExpanded_transitionToAuthScrimmed() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);

        // GIVEN device occluded and panel is NOT expanded
        mCentralSurfaces.setBarStateForTest(SHADE); // occluding on LS has StatusBarState = SHADE
        when(mKeyguardStateController.isOccluded()).thenReturn(true);
        mCentralSurfaces.mPanelExpanded = false;

        mCentralSurfaces.updateScrimController();

        verify(mScrimController).transitionTo(eq(ScrimState.AUTH_SCRIMMED));
    }

    @Test
    public void testOccludingQSExpanded_transitionToAuthScrimmedShade() {
        when(mAlternateBouncerInteractor.isVisibleState()).thenReturn(true);

        // GIVEN device occluded and qs IS expanded
        mCentralSurfaces.setBarStateForTest(SHADE); // occluding on LS has StatusBarState = SHADE
        when(mKeyguardStateController.isOccluded()).thenReturn(true);
        mCentralSurfaces.mPanelExpanded = true;

        mCentralSurfaces.updateScrimController();

        verify(mScrimController).transitionTo(eq(ScrimState.AUTH_SCRIMMED_SHADE));
    }

    @Test
    public void testShowKeyguardImplementation_setsState() {
        when(mLockscreenUserManager.getCurrentProfiles()).thenReturn(new SparseArray<>());