summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Dupin <dupin@google.com>2020-03-11 16:37:28 -0700
committerLucas Dupin <dupin@google.com>2020-03-12 20:01:13 +0000
commit2263309459abe979774735bf3fe5ca53f65fa96a (patch)
tree5fdb04437a63b0f63768d2f297108fe6780b5d36
parent12c8c244a63113612c69d4970878e6722efdaab8 (diff)
downloadbase-2263309459abe979774735bf3fe5ca53f65fa96a.tar.gz
Either reuse sensor values or don't dim down at all
ALS latency is unpredictable and sometimes debounced. This means that it might take at least 3 seconds for the display to wake-up, if it wakes-up at all. We might also get stuck and never show HUNs if the event doesn't arrive. This is a bug that we had in the past, but was not as noticeable because the padlock was below the scrims, now, users are reporting that the padlock shows up, but the hun is not. Test: manual Fixes: 150852696 Change-Id: Iade5ebd4c33e7c9d668b09144964f1408ef529ad Merged-In: Iade5ebd4c33e7c9d668b09144964f1408ef529ad
-rw-r--r--packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java11
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java42
2 files changed, 2 insertions, 51 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
index c27e633f2a96..1145501f4c51 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
@@ -155,15 +155,8 @@ public class DozeScreenBrightness extends BroadcastReceiver implements DozeMachi
}
int scrimOpacity = -1;
- if (mPaused || mScreenOff) {
- // If AOD is paused, force the screen black until the
- // sensor reports a new brightness. This ensures that when the screen comes on
- // 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.
+ if (mLightSensor == null) {
+ // No light sensor, scrims are always transparent.
scrimOpacity = 0;
} else if (brightnessReady) {
// Only unblank scrim once brightness is ready.
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 3b760e31b4ac..0e8dffd57079 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
@@ -221,48 +221,6 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
}
@Test
- public void pausingAod_softBlanks() throws Exception {
- mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
- mScreen.transitionTo(INITIALIZED, DOZE_AOD);
-
- mSensor.sendSensorEvent(2);
-
- mScreen.transitionTo(DOZE_AOD, DOZE_AOD_PAUSING);
- mScreen.transitionTo(DOZE_AOD_PAUSING, DOZE_AOD_PAUSED);
-
- assertEquals(1f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
-
- mSensor.sendSensorEvent(0);
- assertEquals(1f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
-
- mScreen.transitionTo(DOZE_AOD_PAUSED, DOZE_AOD);
- assertEquals(1f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
- }
-
- @Test
- public void pausingAod_softBlanks_withSpuriousSensorDuringPause() throws Exception {
- mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
- mScreen.transitionTo(INITIALIZED, DOZE_AOD);
- mScreen.transitionTo(DOZE_AOD, DOZE_AOD_PAUSING);
- mScreen.transitionTo(DOZE_AOD_PAUSING, DOZE_AOD_PAUSED);
-
- mSensor.sendSensorEvent(1);
- assertEquals(1f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
- }
-
- @Test
- public void screenOff_softBlanks() throws Exception {
- mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
- mScreen.transitionTo(INITIALIZED, DOZE_AOD);
- mScreen.transitionTo(DOZE_AOD, DOZE);
- assertEquals(1f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
-
- mScreen.transitionTo(DOZE, DOZE_AOD);
- mSensor.sendSensorEvent(2);
- assertEquals(0f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
- }
-
- @Test
public void pausingAod_unblanksAfterSensor() throws Exception {
mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
mScreen.transitionTo(INITIALIZED, DOZE_AOD);