Skip to content

Commit 122415f

Browse files
author
Iliyan Malchev
committed
Set the brightness to zero on screen-off
Fixes b/6996990 Ideally, the HWC HAL should turn off the backlight when the display is turned off. This patch enforces this at the PowerManager, which can guard against errant HWC implementations. Change-Id: Ibb826a02871c983f8a68034d010e68abe9c5c1d5 Signed-off-by: Iliyan Malchev <malchev@google.com>
1 parent ca34bcf commit 122415f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/java/com/android/server/power/DisplayPowerState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ private void apply() {
242242
mElectronBeam.draw(mElectronBeamLevel);
243243
}
244244

245-
if ((mDirty & DIRTY_BRIGHTNESS) != 0) {
246-
mScreenBrightnessModulator.setBrightness(mScreenBrightness);
245+
if ((mDirty & (DIRTY_BRIGHTNESS | DIRTY_SCREEN_ON)) != 0) {
246+
mScreenBrightnessModulator.setBrightness(mScreenOn ? mScreenBrightness : 0);
247247
}
248248

249249
if ((mDirty & DIRTY_SCREEN_ON) != 0 && mScreenOn) {

0 commit comments

Comments
 (0)