SF: update kernel idle timer when active display changes
The refresh rate policy for a display might change when it is not
the active display, and when this display becomes active, we need
to update the kernel timer to reflect the updated policy.
Bug: 188838426
Test: check graphics.display.kernel_idle_timer.enabled is updated
according to the most updated policy when switching active
display.
Change-Id: I94ee9a019e4f38bf1bd28202144dbc30af2f9261
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6dae07d..82bd398 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -7052,6 +7052,10 @@
mScheduler->setRefreshRateConfigs(activeDisplay->holdRefreshRateConfigs());
onActiveDisplaySizeChanged(activeDisplay);
mActiveDisplayTransformHint = activeDisplay->getTransformHint();
+
+ // Update the kernel timer for the current active display, since the policy
+ // for this display might have changed when it was not the active display.
+ toggleKernelIdleTimer();
}
status_t SurfaceFlinger::addWindowInfosListener(