Merge "[DO NOT MERGE] Fix AoD front scrim being opaque at DOZE_PULSING" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3bc45ce2ab
@@ -161,6 +161,10 @@ public class DozeScreenBrightness extends BroadcastReceiver implements DozeMachi
|
|||||||
// again, it will only show after the brightness sensor has stabilized,
|
// again, it will only show after the brightness sensor has stabilized,
|
||||||
// avoiding a potential flicker.
|
// avoiding a potential flicker.
|
||||||
scrimOpacity = 255;
|
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) {
|
} else if (brightnessReady) {
|
||||||
// Only unblank scrim once brightness is ready.
|
// Only unblank scrim once brightness is ready.
|
||||||
scrimOpacity = computeScrimOpacity(sensorValue);
|
scrimOpacity = computeScrimOpacity(sensorValue);
|
||||||
|
|||||||
@@ -156,6 +156,20 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
|
|||||||
assertEquals(1, mServiceFake.screenBrightness);
|
assertEquals(1, mServiceFake.screenBrightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPulsing_withoutLightSensor_setsAoDDimmingScrimTransparent() throws Exception {
|
||||||
|
mScreen = new DozeScreenBrightness(mContext, mServiceFake, mSensorManager,
|
||||||
|
null /* sensor */, mHostFake, null /* handler */,
|
||||||
|
DEFAULT_BRIGHTNESS, SENSOR_TO_BRIGHTNESS, SENSOR_TO_OPACITY,
|
||||||
|
true /* debuggable */);
|
||||||
|
mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
|
||||||
|
mScreen.transitionTo(INITIALIZED, DOZE);
|
||||||
|
|
||||||
|
mScreen.transitionTo(DOZE, DOZE_REQUEST_PULSE);
|
||||||
|
|
||||||
|
assertEquals(0f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDozingAfterPulsing_pausesLightSensor() throws Exception {
|
public void testDozingAfterPulsing_pausesLightSensor() throws Exception {
|
||||||
mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
|
mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
|
||||||
|
|||||||
Reference in New Issue
Block a user