Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 550d324a authored by liuquanrui's avatar liuquanrui
Browse files

Support Ultra HDR only if the device support setting brightness by SurfaceControl.



Some devices do not support setting brightness by SurfaceControl due to older vendor versions, and running the Ultra HDR app on these devices may cause screen flicker. We need block the Ultra HDR in these devices.

Bug: 321640484

Change-Id: I4efda9ee98c12bf53c58e934aa4b0c0a423c5cbe
Signed-off-by: default avatarliuquanrui <liuquanrui@xiaomi.corp-partner.google.com>
parent e7400713
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -987,7 +987,9 @@ final class LocalDisplayAdapter extends DisplayAdapter {

                    void handleHdrSdrNitsChanged(float displayNits, float sdrNits) {
                        final float newHdrSdrRatio;
                        if (displayNits != INVALID_NITS && sdrNits != INVALID_NITS) {
                        if (displayNits != INVALID_NITS && sdrNits != INVALID_NITS
                            && (mBacklightAdapter.mUseSurfaceControlBrightness ||
                                mBacklightAdapter.mForceSurfaceControl)) {
                            // Ensure the ratio stays >= 1.0f as values below that are nonsensical
                            newHdrSdrRatio = Math.max(1.f, displayNits / sdrNits);
                        } else {