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

Commit dad8efc6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix AoD front scrim being opaque at DOZE_PULSING"

parents fe11fb05 2f2d03d1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -167,6 +167,10 @@ public class DozeScreenBrightness extends BroadcastReceiver implements DozeMachi
                // again, it will only show after the brightness sensor has stabilized,
                // avoiding a potential flicker.
                scrimOpacity = 255;
            } else if (!mScreenOff && mLightSensor == null) {
                // No light sensor but previous state turned the screen black. Make the scrim
                // transparent and below views visible.
                scrimOpacity = 0;
            } else if (brightnessReady) {
                // Only unblank scrim once brightness is ready.
                scrimOpacity = computeScrimOpacity(sensorValue);
+15 −0
Original line number Diff line number Diff line
@@ -172,6 +172,21 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        assertEquals(1, mServiceFake.screenBrightness);
    }

    @Test
    public void testPulsing_withoutLightSensor_setsAoDDimmingScrimTransparent() throws Exception {
        mScreen = new DozeScreenBrightness(mContext, mServiceFake, mSensorManager,
                null /* sensor */, mBroadcastDispatcher, mDozeHost, null /* handler */,
                DEFAULT_BRIGHTNESS, SENSOR_TO_BRIGHTNESS, SENSOR_TO_OPACITY,
                true /* debuggable */);
        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);
        reset(mDozeHost);

        mScreen.transitionTo(DOZE, DOZE_REQUEST_PULSE);

        verify(mDozeHost).setAodDimmingScrim(eq(0f));
    }

    @Test
    public void testDockedAod_usesLightSensor() {
        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);