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

Commit ed15607f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

Merge "Support Ultra HDR only if the device support setting brightness by SurfaceControl." into main
parents 27fb8ed2 550d324a
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -986,7 +986,9 @@ final class LocalDisplayAdapter extends DisplayAdapter {


                    void handleHdrSdrNitsChanged(float displayNits, float sdrNits) {
                    void handleHdrSdrNitsChanged(float displayNits, float sdrNits) {
                        final float newHdrSdrRatio;
                        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
                            // Ensure the ratio stays >= 1.0f as values below that are nonsensical
                            newHdrSdrRatio = Math.max(1.f, displayNits / sdrNits);
                            newHdrSdrRatio = Math.max(1.f, displayNits / sdrNits);
                        } else {
                        } else {