[SF] Change VSyncDispatchTimerQueue::Schedule to return ScheduleResult
Removes the optional return as Schedule always returns value.
BUG: 284845445
Test: atest VSyncDispatchTimerQueueTest
Change-Id: I5b0dd11144ff5df227a9fa23a3a3ded3b50f3ea2
diff --git a/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.cpp b/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.cpp
index 2a3e5b6..84ccf8e 100644
--- a/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.cpp
+++ b/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.cpp
@@ -85,8 +85,8 @@
return {mArmedInfo->mActualVsyncTime};
}
-std::optional<ScheduleResult> VSyncDispatchTimerQueueEntry::schedule(
- VSyncDispatch::ScheduleTiming timing, VSyncTracker& tracker, nsecs_t now) {
+ScheduleResult VSyncDispatchTimerQueueEntry::schedule(VSyncDispatch::ScheduleTiming timing,
+ VSyncTracker& tracker, nsecs_t now) {
auto nextVsyncTime =
tracker.nextAnticipatedVSyncTimeFrom(std::max(timing.lastVsync,
now + timing.workDuration +
@@ -407,16 +407,13 @@
return callback->addPendingWorkloadUpdate(*mTracker, now, scheduleTiming);
}
- const auto resultOpt = callback->schedule(scheduleTiming, *mTracker, now);
+ const auto result = callback->schedule(scheduleTiming, *mTracker, now);
- if (!resultOpt) {
- return {};
- }
if (callback->wakeupTime() < mIntendedWakeupTime - mTimerSlack) {
rearmTimerSkippingUpdateFor(now, it);
}
- return resultOpt;
+ return result;
}
std::optional<ScheduleResult> VSyncDispatchTimerQueue::update(CallbackToken token,
diff --git a/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.h b/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.h
index afb67ae..252c09c 100644
--- a/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.h
+++ b/services/surfaceflinger/Scheduler/VSyncDispatchTimerQueue.h
@@ -48,8 +48,7 @@
std::optional<nsecs_t> lastExecutedVsyncTarget() const;
// This moves the state from disarmed->armed and will calculate the wakeupTime.
- std::optional<ScheduleResult> schedule(VSyncDispatch::ScheduleTiming, VSyncTracker&,
- nsecs_t now);
+ ScheduleResult schedule(VSyncDispatch::ScheduleTiming, VSyncTracker&, nsecs_t now);
// This will update armed entries with the latest vsync information. Entry remains armed.
void update(VSyncTracker&, nsecs_t now);