Skip to content

Commit ae47679

Browse files
Dan GittikIntelliJAbhishek
authored andcommitted
Fixed auto-brightness first screen update.
When auto-brightness is enabled, it should update the screen as soon as ALS data is available; however, if that data results in the same screen brightness as before, this update is optimised away, even though it should be applied (in case the actual screen brightness did change, e.g. by a user who turned adaptive brightness off). Test: Turn adaptive brightness off; set the screen brightness to 0; turn adaptive brightness on again (do so several times). Before the fix, it would often take a while for the screen to brighten (because similar ALS data results in the same screen brightness as before, an thus no update is issued). After the fix, it should brighten immediately. Fixes: 111381286 (cherry picked from commit f387dd7) CRs-Fixed: 2403457 Change-Id: I8f0c8a9bf3d2dd7ceb520a95097eb4485f27196c
1 parent 8291675 commit ae47679

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

services/core/java/com/android/server/display/AutomaticBrightnessController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ private boolean setLightSensorEnabled(boolean enable) {
406406
} else if (mLightSensorEnabled) {
407407
mLightSensorEnabled = false;
408408
mAmbientLuxValid = !mResetAmbientLuxAfterWarmUpConfig;
409+
mScreenAutoBrightness = -1;
409410
mRecentLightSamples = 0;
410411
mAmbientLightRingBuffer.clear();
411412
mCurrentLightSensorRate = -1;

0 commit comments

Comments
 (0)