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

Commit c0491498 authored by Marin Shalamanov's avatar Marin Shalamanov Committed by Ady Abraham
Browse files

DMS: Reduce the THRESHOLD_FOR_REFRESH_RATES_DIVIDERS

Reduce the threshold to 0.0009 so the code can
differentiate between 59.94 and 90 fps.

Bug: 196191168
Test: presubmit
Change-Id: Iecfb523e1b7fbd601ad99655d9ecf1d88d2a58bf
(cherry picked from commit 17717429)
parent 1902c78c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -192,7 +192,9 @@ public final class DisplayManagerService extends SystemService {


    private static final String PROP_DEFAULT_DISPLAY_TOP_INSET = "persist.sys.displayinset.top";
    private static final String PROP_DEFAULT_DISPLAY_TOP_INSET = "persist.sys.displayinset.top";
    private static final long WAIT_FOR_DEFAULT_DISPLAY_TIMEOUT = 10000;
    private static final long WAIT_FOR_DEFAULT_DISPLAY_TIMEOUT = 10000;
    private static final float THRESHOLD_FOR_REFRESH_RATES_DIVIDERS = 0.1f;
    // This value needs to be in sync with the threshold
    // in RefreshRateConfigs::getFrameRateDivider.
    private static final float THRESHOLD_FOR_REFRESH_RATES_DIVIDERS = 0.0009f;


    private static final int MSG_REGISTER_DEFAULT_DISPLAY_ADAPTERS = 1;
    private static final int MSG_REGISTER_DEFAULT_DISPLAY_ADAPTERS = 1;
    private static final int MSG_REGISTER_ADDITIONAL_DISPLAY_ADAPTERS = 2;
    private static final int MSG_REGISTER_ADDITIONAL_DISPLAY_ADAPTERS = 2;
@@ -812,7 +814,7 @@ public final class DisplayManagerService extends SystemService {


        // Override the refresh rate only if it is a divider of the current
        // Override the refresh rate only if it is a divider of the current
        // refresh rate. This calculation needs to be in sync with the native code
        // refresh rate. This calculation needs to be in sync with the native code
        // in RefreshRateConfigs::getRefreshRateDividerForUid
        // in RefreshRateConfigs::getFrameRateDivider
        Display.Mode currentMode = info.getMode();
        Display.Mode currentMode = info.getMode();
        float numPeriods = currentMode.getRefreshRate() / frameRateHz;
        float numPeriods = currentMode.getRefreshRate() / frameRateHz;
        float numPeriodsRound = Math.round(numPeriods);
        float numPeriodsRound = Math.round(numPeriods);