SF: reset the idle timer if a frame is scheduled
There is a case where the idle timer might expire while SF is active
as it is not getting reset if SF was already scheduled from some other
reason.
Change-Id: If79b2df4f0fe56b70658a5495069a556d3fdfc79
Test: atest android.platform.test.scenario.sysui.bubble.ShowBubbleAndShowImeMicrobenchmark#testShowBubbleAndShowIme
Bug: 264952266
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 40de4d6..5c609d6 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3843,6 +3843,10 @@
if (const bool scheduled = mTransactionFlags.fetch_or(mask) & mask; !scheduled) {
scheduleCommit(frameHint);
+ } else if (frameHint == FrameHint::kActive) {
+ // Even if the next frame is already scheduled, we should reset the idle timer
+ // as a new activity just happened.
+ mScheduler->resetIdleTimer();
}
}