diff options
| author | 2018-07-12 14:22:08 +0100 | |
|---|---|---|
| committer | 2018-07-12 14:22:08 +0100 | |
| commit | 3d2c5af8c6de295c54f86069bf6a39374eabdbf8 (patch) | |
| tree | 76b428af1c37a92d827f896b4a88b4bd0b7201de | |
| parent | 267b960dab63200b6ba4dc53dfc7e7ed064986fc (diff) | |
Fixed temporary brightness getting stuck bug.
When the user would set the brightness to the same value, the
temporary brightness would remain applied, effectively disabling
auto-brightness and confusing the system state.
Test: Drag the slider to an extremity (e.g. maximum), let it go, and
then re-drag the slider to the same place (e.g. place your finger
on the middle of the slider and move it to the maximum again).
run adb shell dumpsys display | grep mAppliedTemporaryBrightness
to check whether temporary brightness is applied; should be false.
Change-Id: Id3a1bff533b1bee9ca760e742dab379eeeb4b14e
Fixes: 111050860
| -rw-r--r-- | services/core/java/com/android/server/display/DisplayPowerController.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java index 99412c56b274..b124ac78a8ef 100644 --- a/services/core/java/com/android/server/display/DisplayPowerController.java +++ b/services/core/java/com/android/server/display/DisplayPowerController.java @@ -791,9 +791,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call && mAutomaticBrightnessController != null; final boolean userSetBrightnessChanged = updateUserSetScreenBrightness(); - if (userSetBrightnessChanged) { - mTemporaryScreenBrightness = -1; - } // Use the temporary screen brightness if there isn't an override, either from // WindowManager or based on the display state. @@ -1514,11 +1511,13 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call } if (mCurrentScreenBrightnessSetting == mPendingScreenBrightnessSetting) { mPendingScreenBrightnessSetting = -1; + mTemporaryScreenBrightness = -1; return false; } mCurrentScreenBrightnessSetting = mPendingScreenBrightnessSetting; mLastUserSetScreenBrightness = mPendingScreenBrightnessSetting; mPendingScreenBrightnessSetting = -1; + mTemporaryScreenBrightness = -1; return true; } |