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

Commit 59d876a7 authored by Su Hong Koo's avatar Su Hong Koo Committed by Android (Google) Code Review
Browse files

Merge "SF: Re-initialize EventThread::mVSyncState on new pacesetter selection" into main

parents 7c5fb4b2 fa35a066
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -877,6 +877,16 @@ scheduler::VSyncCallbackRegistration EventThread::onNewVsyncScheduleInternal(
                                     .lastVsync = mLastVsyncCallbackTime.ns(),
                                     .committedVsyncOpt = mLastCommittedVsyncTime.ns()});
    }

    // Hotplug disconnect causes mVSyncState to get nuked when the pacesetter display is
    // disconnected. Without mVSyncState, all vsync events are ignored, and thus the apps freeze
    // their transactions. The only way to revive the 'mVSyncState' right now is a new Hotplug
    // connect event. We should also revive 'mVSyncState' here so that when a new pacesetter is
    // selected, it can have a new vsync state.
    if (FlagManager::getInstance().pacesetter_selection() && !mVSyncState) {
        SFTRACE_FORMAT_INSTANT("OnNewVsyncScheduleInternalNewState");
        mVSyncState.emplace();
    }
    return oldRegistration;
}