Mark mAutomaticBrightnessController @Nullable. am: 3695613b6f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16212770

Change-Id: I1692c8cdc2bcdbef5fcfd1119baefff6bcc4e212
This commit is contained in:
Philip Junker
2021-11-08 13:23:15 +00:00
committed by Automerger Merge Worker

View File

@@ -378,6 +378,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
private float mInitialAutoBrightness;
// The controller for the automatic brightness level.
@Nullable
private AutomaticBrightnessController mAutomaticBrightnessController;
private Sensor mLightSensor;
@@ -608,7 +609,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
mPendingRbcOnOrChanged = strengthChanged || justActivated;
// Reset model if strength changed OR rbc is turned off
if (strengthChanged || !justActivated && mAutomaticBrightnessController != null) {
if ((strengthChanged || !justActivated) && mAutomaticBrightnessController != null) {
mAutomaticBrightnessController.resetShortTermModel();
}
}
@@ -1567,7 +1568,9 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
sendUpdatePowerStateLocked();
mHandler.post(mOnBrightnessChangeRunnable);
// TODO(b/192258832): Switch the HBMChangeCallback to a listener pattern.
mAutomaticBrightnessController.update();
if (mAutomaticBrightnessController != null) {
mAutomaticBrightnessController.update();
}
}, mContext);
}