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

Commit cae12a92 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure "matching" modes consider HDR types" into main

parents 37c6d36c 0fd7cebc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2652,7 +2652,8 @@ public final class Display {
         * @hide
         */
        public boolean equalsExceptRefreshRate(@Nullable Display.Mode other) {
            return mWidth == other.mWidth && mHeight == other.mHeight;
            return mWidth == other.mWidth && mHeight == other.mHeight
                    && mSupportedHdrTypes == other.mSupportedHdrTypes;
        }

        /**
+4 −3
Original line number Diff line number Diff line
@@ -1548,7 +1548,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
        }
    }

    private boolean hdrTypesEqual(int[] modeHdrTypes, int[] recordHdrTypes) {
    private static boolean hdrTypesEqual(int[] modeHdrTypes, int[] recordHdrTypes) {
        int[] modeHdrTypesCopy = Arrays.copyOf(modeHdrTypes, modeHdrTypes.length);
        Arrays.sort(modeHdrTypesCopy);
        // Record HDR types are already sorted when we create the DisplayModeRecord
@@ -1588,7 +1588,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
                    && Float.floatToIntBits(mMode.getRefreshRate())
                    == Float.floatToIntBits(mode.peakRefreshRate)
                    && Float.floatToIntBits(mMode.getVsyncRate())
                            == Float.floatToIntBits(mode.vsyncRate);
                    == Float.floatToIntBits(mode.vsyncRate)
                    && hdrTypesEqual(mode.supportedHdrTypes, mMode.getSupportedHdrTypes());
        }

        public String toString() {
+2 −2
Original line number Diff line number Diff line
@@ -4714,7 +4714,7 @@ public class DisplayManagerServiceTest {
        if (compatChangeEnabled) {
            expectedMode = new Display.Mode(1, 100, 200, 60f);
        } else {
            expectedMode = new Display.Mode(3, 100, 200, 20f);
            expectedMode = new Display.Mode(255, 100, 200, 20f);
        }
        assertEquals(expectedMode, displayInfo.getMode());
    }
@@ -4741,7 +4741,7 @@ public class DisplayManagerServiceTest {
        if (compatChangeEnabled) {
            expectedMode = new Display.Mode(1, 100, 200, 60f);
        } else {
            expectedMode = new Display.Mode(3, 100, 200, 20f);
            expectedMode = new Display.Mode(255, 100, 200, 20f);
        }
        assertEquals(expectedMode, displayInfo.getMode());
    }