From b8f4f77d9e12e125408b058bcbd505f4a0bdd50e Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Tue, 1 May 2018 18:28:58 +0100 Subject: [PATCH] Reset auto-brightness on new BrightnessConfiguration In theory, the newly pushed configuration should take into account all of the brightness adjustments that the user has made throughout the day, so applying any part of the short term model on top of that would be effectively adjusting for them twice over. To avoid getting into this state, we reset the short-term model. Bug: 78910182 Test: Manual Change-Id: I52121eac84eb8ceb914a94a95af2f174ab2f5b73 --- .../server/display/AutomaticBrightnessController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/display/AutomaticBrightnessController.java b/services/core/java/com/android/server/display/AutomaticBrightnessController.java index 0425844bd9e3a..ce25a9f99e954 100644 --- a/services/core/java/com/android/server/display/AutomaticBrightnessController.java +++ b/services/core/java/com/android/server/display/AutomaticBrightnessController.java @@ -330,7 +330,11 @@ class AutomaticBrightnessController { } public boolean setBrightnessConfiguration(BrightnessConfiguration configuration) { - return mBrightnessMapper.setBrightnessConfiguration(configuration); + if (mBrightnessMapper.setBrightnessConfiguration(configuration)) { + resetShortTermModel(); + return true; + } + return false; } public void dump(PrintWriter pw) {