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
Merged-In: I3a87d0b505b8bf8ce411c86a061376aadba42a88
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index f14bef3..b91dece 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -284,8 +284,8 @@
// allow initial power mode as null.
std::optional<hardware::graphics::composer::hal::PowerMode> mPowerMode;
DisplayModePtr mActiveMode;
- std::optional<float> mStagedBrightness = std::nullopt;
- float mBrightness = -1.f;
+ std::optional<float> mStagedBrightness;
+ std::optional<float> mBrightness;
const DisplayModes mSupportedModes;
std::atomic<nsecs_t> mLastHwVsync = 0;