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

Commit df63752e authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "SF: fix a bug with DISPLAY_EVENT_MODE_CHANGE" into sc-v2-dev

parents 3590b6c8 d1591701
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -395,6 +395,14 @@ void Scheduler::dispatchCachedReportedMode() {
        return;
    }

    // If the mode is not the current mode, this means that a
    // mode change is in progress. In that case we shouldn't dispatch an event
    // as it will be dispatched when the current mode changes.
    if (std::scoped_lock lock(mRefreshRateConfigsLock);
        mRefreshRateConfigs->getCurrentRefreshRate().getMode() != mFeatures.mode) {
        return;
    }

    // If there is no change from cached mode, there is no need to dispatch an event
    if (mFeatures.mode == mFeatures.cachedModeChangedParams->mode) {
        return;