diff options
| author | 2024-05-15 18:37:02 -0700 | |
|---|---|---|
| committer | 2024-05-15 18:41:31 -0700 | |
| commit | 0cd9e86cb5e57e19e4b099cb2f5298dbca3f1250 (patch) | |
| tree | 172e8c7a63e93c546dcba72313b98acf8f2ef460 | |
| parent | 9691faf3dbe153af7f51594ba7d72ff730237bfb (diff) | |
Fix hdrsdrratiooverlay backdoor logic.
- we only accept 1/0 for this backdoor. However, in the current logic,
if other non-zero number is set, the current logic assumes this
overlay to be enabled. But in the switch code block, we don't enable this backdoor and instead the logic falls into default section.
Bug: n/a
Test: test this backdoor
Change-Id: Icfc7d6b661667cebaba103177559c56b05c0cc00
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 0d2e5142bc..ffa9af9493 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -7499,14 +7499,11 @@ status_t SurfaceFlinger::onTransact(uint32_t code, const Parcel& data, Parcel* r auto future = mScheduler->schedule( [&]() FTL_FAKE_GUARD(mStateLock) FTL_FAKE_GUARD(kMainThreadContext) { n = data.readInt32(); - mHdrSdrRatioOverlay = n != 0; - switch (n) { - case 0: - case 1: - enableHdrSdrRatioOverlay(mHdrSdrRatioOverlay); - break; - default: - reply->writeBool(isHdrSdrRatioOverlayEnabled()); + if (n == 0 || n == 1) { + mHdrSdrRatioOverlay = n != 0; + enableHdrSdrRatioOverlay(mHdrSdrRatioOverlay); + } else { + reply->writeBool(isHdrSdrRatioOverlayEnabled()); } }); future.wait(); |