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

Commit 4a46b355 authored by Rachel Lee's avatar Rachel Lee Committed by Android (Google) Code Review
Browse files

Merge "Check for mIdleTimer instead of fatal log" into main

parents 0afaa4e6 50edf0f7
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1395,14 +1395,15 @@ auto RefreshRateSelector::setPolicy(const PolicyVariant& policy) -> SetPolicyRes
        const auto& idleScreenConfigOpt = getCurrentPolicyLocked()->idleScreenConfigOpt;
        if (idleScreenConfigOpt != oldPolicy.idleScreenConfigOpt) {
            if (!idleScreenConfigOpt.has_value()) {
                if (mIdleTimer) {
                    // fallback to legacy timer if existed, otherwise pause the old timer
                LOG_ALWAYS_FATAL_IF(!mIdleTimer);
                    if (mConfig.legacyIdleTimerTimeout > 0ms) {
                        mIdleTimer->setInterval(mConfig.legacyIdleTimerTimeout);
                        mIdleTimer->resume();
                    } else {
                        mIdleTimer->pause();
                    }
                }
            } else if (idleScreenConfigOpt->timeoutMillis > 0) {
                // create a new timer or reconfigure
                const auto timeout = std::chrono::milliseconds{idleScreenConfigOpt->timeoutMillis};