diff options
| -rw-r--r-- | services/surfaceflinger/Scheduler/EventThread.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/services/surfaceflinger/Scheduler/EventThread.cpp b/services/surfaceflinger/Scheduler/EventThread.cpp index ba43e705d4..6553efe794 100644 --- a/services/surfaceflinger/Scheduler/EventThread.cpp +++ b/services/surfaceflinger/Scheduler/EventThread.cpp @@ -354,7 +354,7 @@ void EventThread::onVSyncEvent(nsecs_t timestamp, nsecs_t expectedVSyncTimestamp return mTokenManager->generateTokenForPredictions( {timestamp, deadlineTimestamp, expectedVSyncTimestamp}); } - return static_cast<int64_t>(0); + return FrameTimelineInfo::INVALID_VSYNC_ID; }(); mPendingEvents.push_back(makeVSync(mVSyncState->displayId, timestamp, ++mVSyncState->count, @@ -494,10 +494,16 @@ void EventThread::threadMain(std::unique_lock<std::mutex>& lock) { const auto now = systemTime(SYSTEM_TIME_MONOTONIC); const auto deadlineTimestamp = now + timeout.count(); const auto expectedVSyncTime = deadlineTimestamp + timeout.count(); - // TODO(b/162890590): use TokenManager to populate vsyncId + const int64_t vsyncId = [&] { + if (mTokenManager != nullptr) { + return mTokenManager->generateTokenForPredictions( + {now, deadlineTimestamp, expectedVSyncTime}); + } + return FrameTimelineInfo::INVALID_VSYNC_ID; + }(); mPendingEvents.push_back(makeVSync(mVSyncState->displayId, now, ++mVSyncState->count, expectedVSyncTime, - deadlineTimestamp, /*vsyncId=*/0)); + deadlineTimestamp, vsyncId)); } } } |