summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java15
2 files changed, 19 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
index 4e887262659e..ca2226f29528 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
@@ -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);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
index 399f723f4d62..9117ea8f9fc2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
@@ -173,6 +173,21 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
}
@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);
mScreen.transitionTo(INITIALIZED, DOZE_AOD_DOCKED);