Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8247add5 authored by Jim Miller's avatar Jim Miller Committed by Android (Google) Code Review
Browse files

Merge "Fix 6119433: disambiguate screen brightness changes from other lights"

parents 94828c3f 18651804
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2234,15 +2234,19 @@ public class PowerManagerService extends IPowerManager.Stub
                }

                if (target != currentValue) {
                    final boolean doScreenAnim = (mask & (SCREEN_BRIGHT_BIT | SCREEN_ON_BIT)) != 0;
                    final boolean turningOff = endValue == Power.BRIGHTNESS_OFF;
                    if (turningOff && ((mask & (SCREEN_ON_BIT | SCREEN_BRIGHT_BIT)) != 0)) {
                    if (turningOff && doScreenAnim) {
                        // Cancel all pending animations since we're turning off
                        mScreenBrightnessHandler.removeCallbacksAndMessages(null);
                        screenOffFinishedAnimatingLocked(mScreenOffReason);
                        duration = 200; // TODO: how long should this be?
                    }
                    if (doScreenAnim) {
                        animateInternal(mask, turningOff, 0);
                    }
                    // TODO: Handle keyboard light animation when we have devices that support it
                }
            }
        }