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

Commit c764daa2 authored by Oleg Blinnikov's avatar Oleg Blinnikov Committed by Android (Google) Code Review
Browse files

Merge "Allow Float tolerance during resolution search" into main

parents cb1adc75 24946b2e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -724,8 +724,9 @@ public class DisplayModeDirector {
                    || mode.getPhysicalHeight() > maxAllowedHeight
                    || mode.getPhysicalWidth() < outSummary.minWidth
                    || mode.getPhysicalHeight() < outSummary.minHeight
                    || mode.getRefreshRate() < outSummary.minPhysicalRefreshRate
                    || mode.getRefreshRate() > outSummary.maxPhysicalRefreshRate) {
                    || mode.getRefreshRate() < (outSummary.minPhysicalRefreshRate - FLOAT_TOLERANCE)
                    || mode.getRefreshRate() > (outSummary.maxPhysicalRefreshRate + FLOAT_TOLERANCE)
            ) {
                continue;
            }

+13 −1
Original line number Diff line number Diff line
@@ -229,7 +229,19 @@ public class DisplayModeDirectorTest {
                                    LIMIT_MODE_70.getPhysicalWidth(),
                                    LIMIT_MODE_70.getPhysicalHeight(),
                                    0, APP_MODE_65.getRefreshRate())),
                        /*displayResolutionRangeVotingEnabled*/ true}});
                        /*displayResolutionRangeVotingEnabled*/ true},
                {/*expectedBaseModeId*/ APP_MODE_65.getModeId(),
                        /*expectedPhysicalRefreshRate*/ 64.99f,
                        /*expectedAppRequestedRefreshRate*/ 64.99f,
                        /*votesWithPriorities*/ Map.of(
                                Vote.PRIORITY_APP_REQUEST_BASE_MODE_REFRESH_RATE,
                                Vote.forBaseModeRefreshRate(APP_MODE_65.getRefreshRate()),
                                Vote.PRIORITY_APP_REQUEST_SIZE,
                                Vote.forSize(APP_MODE_65.getPhysicalWidth(),
                                        APP_MODE_65.getPhysicalHeight()),
                                Vote.PRIORITY_LOW_POWER_MODE,
                                Vote.forPhysicalRefreshRates(
                                        0, 64.99f))}});

        final var res = new ArrayList<Object[]>(appRequestedSizeTestCases.size() * 2);