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

Commit 180d8008 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: stay with the current mode when all votes are NO_PREF

The current code intended to do the same, however because of
the workaround for b/266481656 it didn't.

Bug: 333443503
Test: Settings -> About Phone and observe the refresh rate indicator
Flag: EXEMPT bugfix
Change-Id: Ic48c31af6562bb29be45f1fbab4abebb2788b551
parent da62cb20
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -634,11 +634,12 @@ auto RefreshRateSelector::getRankedFrameRatesLocked(const std::vector<LayerRequi
    // If all layers are category NoPreference, use the current config.
    if (noPreferenceLayers + noVoteLayers == layers.size()) {
        ALOGV("All layers NoPreference");
        const auto ascendingWithPreferred =
                rankFrameRates(anchorGroup, RefreshRateOrder::Ascending, activeMode.getId());
        constexpr float kScore = std::numeric_limits<float>::max();
        FrameRateRanking currentMode;
        currentMode.emplace_back(ScoredFrameRate{getActiveModeLocked(), kScore});
        SFTRACE_FORMAT_INSTANT("%s (All layers NoPreference)",
                               to_string(ascendingWithPreferred.front().frameRateMode.fps).c_str());
        return {ascendingWithPreferred, kNoSignals};
                              to_string(currentMode.front().frameRateMode.fps).c_str());
        return {currentMode, kNoSignals};
    }

    const bool smoothSwitchOnly = categorySmoothSwitchOnlyLayers > 0;