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

Commit ea25ddfe authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

SF: Remove RefreshRateConfigs::getAllRefreshRates()

Remove this function since it's (almost) unused.

Test: adb shell service call SurfaceFlinger 1035 i32 5
Bug: 159590486
Change-Id: Iaec883eb2b29fd8064885dcb4e590c0e7b6021cf
parent 9149533a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -463,10 +463,6 @@ const RefreshRate* RefreshRateConfigs::getBestRefreshRate(Iter begin, Iter end)
    return bestRefreshRate;
}

const AllRefreshRatesMapType& RefreshRateConfigs::getAllRefreshRates() const {
    return mRefreshRates;
}

const RefreshRate& RefreshRateConfigs::getMinRefreshRateByPolicy() const {
    std::lock_guard lock(mLock);
    return getMinRefreshRateByPolicyLocked();
+0 −3
Original line number Diff line number Diff line
@@ -263,9 +263,6 @@ public:
                                          GlobalSignals* outSignalsConsidered = nullptr) const
            EXCLUDES(mLock);

    // Returns all the refresh rates supported by the device. This won't change at runtime.
    const AllRefreshRatesMapType& getAllRefreshRates() const EXCLUDES(mLock);

    // Returns the lowest refresh rate supported by the device. This won't change at runtime.
    const RefreshRate& getMinRefreshRate() const { return *mMinSupportedRefreshRate; }

+9 −4
Original line number Diff line number Diff line
@@ -5309,12 +5309,17 @@ status_t SurfaceFlinger::onTransact(uint32_t code, const Parcel& data, Parcel* r
                return NO_ERROR;
            }
            case 1035: {
                n = data.readInt32();
                const int newConfigId = data.readInt32();
                mDebugDisplayConfigSetByBackdoor = false;
                const auto numConfigs = mRefreshRateConfigs->getAllRefreshRates().size();
                if (n >= 0 && n < numConfigs) {
                const auto displayId = getInternalDisplayId();
                if (!displayId) {
                    ALOGE("No internal display found.");
                    return NO_ERROR;
                }
                const auto numConfigs = getHwComposer().getConfigs(*displayId).size();
                if (newConfigId >= 0 && newConfigId < numConfigs) {
                    const auto displayToken = getInternalDisplayToken();
                    status_t result = setActiveConfig(displayToken, n);
                    status_t result = setActiveConfig(displayToken, newConfigId);
                    if (result != NO_ERROR) {
                        return result;
                    }