Fix the issue of null previous brightness reason in the logs

Bug: 268459499
Test: Manually verified the logs are now as expected
Change-Id: I88a8be939d15d60d9e90df62909fa9b0031ca199
This commit is contained in:
Rupesh Bansal
2023-02-23 08:47:37 +00:00
parent ccf11a084b
commit 1c835f0bfb
2 changed files with 2 additions and 1 deletions

View File

@@ -1148,6 +1148,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
final int previousPolicy;
boolean mustInitialize = false;
int brightnessAdjustmentFlags = 0;
mBrightnessReasonTemp.set(null);
mTempBrightnessEvent.reset();
SparseArray<DisplayPowerControllerInterface> displayBrightnessFollowers;
synchronized (mLock) {

View File

@@ -100,7 +100,7 @@ public final class BrightnessEvent {
* A utility to reset the BrightnessEvent to default values
*/
public void reset() {
mReason.set(null);
mReason = new BrightnessReason();
mTime = SystemClock.uptimeMillis();
mPhysicalDisplayId = "";
// Lux values