Merge "DM: use the right terminology for divisor" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-02-24 16:51:35 +00:00
committed by Android (Google) Code Review

View File

@@ -204,8 +204,8 @@ public final class DisplayManagerService extends SystemService {
private static final String PROP_DEFAULT_DISPLAY_TOP_INSET = "persist.sys.displayinset.top";
private static final long WAIT_FOR_DEFAULT_DISPLAY_TIMEOUT = 10000;
// This value needs to be in sync with the threshold
// in RefreshRateConfigs::getFrameRateDivider.
private static final float THRESHOLD_FOR_REFRESH_RATES_DIVIDERS = 0.0009f;
// in RefreshRateConfigs::getFrameRateDivisor.
private static final float THRESHOLD_FOR_REFRESH_RATES_DIVISORS = 0.0009f;
private static final int MSG_REGISTER_DEFAULT_DISPLAY_ADAPTERS = 1;
private static final int MSG_REGISTER_ADDITIONAL_DISPLAY_ADAPTERS = 2;
@@ -895,13 +895,13 @@ public final class DisplayManagerService extends SystemService {
return info;
}
// Override the refresh rate only if it is a divider of the current
// Override the refresh rate only if it is a divisor of the current
// refresh rate. This calculation needs to be in sync with the native code
// in RefreshRateConfigs::getFrameRateDivider
// in RefreshRateConfigs::getFrameRateDivisor
Display.Mode currentMode = info.getMode();
float numPeriods = currentMode.getRefreshRate() / frameRateHz;
float numPeriodsRound = Math.round(numPeriods);
if (Math.abs(numPeriods - numPeriodsRound) > THRESHOLD_FOR_REFRESH_RATES_DIVIDERS) {
if (Math.abs(numPeriods - numPeriodsRound) > THRESHOLD_FOR_REFRESH_RATES_DIVISORS) {
return info;
}
frameRateHz = currentMode.getRefreshRate() / numPeriodsRound;
@@ -913,9 +913,9 @@ public final class DisplayManagerService extends SystemService {
continue;
}
if (mode.getRefreshRate() >= frameRateHz - THRESHOLD_FOR_REFRESH_RATES_DIVIDERS
if (mode.getRefreshRate() >= frameRateHz - THRESHOLD_FOR_REFRESH_RATES_DIVISORS
&& mode.getRefreshRate()
<= frameRateHz + THRESHOLD_FOR_REFRESH_RATES_DIVIDERS) {
<= frameRateHz + THRESHOLD_FOR_REFRESH_RATES_DIVISORS) {
if (DEBUG) {
Slog.d(TAG, "found matching modeId " + mode.getModeId());
}