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

Commit 63d72170 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Update scrims when keyguard gets occluded

We were assuming that a show_when_locked window would always be on
the lock screen when the device sleeps, but its possible that,
when charging, a window may come visible after the device enters
doze.

Ideally this should be handled in window manager but not feasible
in P.

Change-Id: I8a1b5e638a8e84bbea3a91fc4ac94feb6195390e
Fixes: 80647623
Test: manual with app from play store
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
parent 843a0cab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -896,6 +896,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo

    public void setKeyguardOccluded(boolean keyguardOccluded) {
        mKeyguardOccluded = keyguardOccluded;
        updateScrims();
    }

    public interface Callback {
+12 −0
Original line number Diff line number Diff line
@@ -541,6 +541,18 @@ public class ScrimControllerTest extends SysuiTestCase {
        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE);
    }

    @Test
    public void testHidesShowWhenLockedActivity_whenAlreadyInAod() {
        mScrimController.setWallpaperSupportsAmbientMode(true);
        mScrimController.transitionTo(ScrimState.AOD);
        mScrimController.finishAnimationsImmediately();
        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_TRANSPARENT);

        mScrimController.setKeyguardOccluded(true);
        mScrimController.finishAnimationsImmediately();
        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE);
    }

    @Test
    public void testEatsTouchEvent() {
        HashSet<ScrimState> eatsTouches =