Allow to apply first brightness as -1
The initial brightness is -1 in DisplayDevice. It won't apply
the brightness(-1) for the first brightness. This allow an
caller to set the brightness to -1
Bug: 254657816
test: atest libsurfaceflinger_unittest:SetDisplayBrightnessTest
Change-Id: I3a87d0b505b8bf8ce411c86a061376aadba42a88
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index d757673..a1eaa38 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -272,7 +272,7 @@
std::optional<hardware::graphics::composer::hal::PowerMode> mPowerMode;
std::optional<float> mStagedBrightness;
- float mBrightness = -1.f;
+ std::optional<float> mBrightness;
// TODO(b/182939859): Remove special cases for primary display.
const bool mIsPrimary;