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

Commit 11b8dd5e authored by Ady Abraham's avatar Ady Abraham Committed by Automerger Merge Worker
Browse files

Merge "DMS: Reduce the THRESHOLD_FOR_REFRESH_RATES_DIVIDERS" into sc-qpr1-dev...

Merge "DMS: Reduce the THRESHOLD_FOR_REFRESH_RATES_DIVIDERS" into sc-qpr1-dev am: 412b6dfe am: c5c595c8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15640930

Change-Id: I8740341bb1847d9c9b35c74d8ba9026228d016a2
parents 86b91fae c5c595c8
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -190,7 +190,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;
@@ -826,7 +828,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);