SF: turn off kernel idle timer when refresh rate switching is disabled
Previously we had an optimization to keep the timer state as is if
the lowest refresh rate setting is the refresh rate the device is locked
at and refresh rate switching is disabled. Removing this optimization
as it is confusing and doesn't provide a lot of added value.
Bug: 191435579
Test: SF unit tests
Change-Id: I206d625c2fafd27623e2c1353a48d56a3b771c7b
diff --git a/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp b/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp
index d04a7d7..4f1b23d 100644
--- a/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp
+++ b/services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp
@@ -1864,10 +1864,10 @@
0);
EXPECT_EQ(KernelIdleTimerAction::TurnOn, refreshRateConfigs->getIdleTimerAction());
- // SetPolicy(60, 60), current 60Hz => NoChange, avoid extra calls.
+ // SetPolicy(60, 60), current 60Hz => TurnOff
ASSERT_GE(refreshRateConfigs->setDisplayManagerPolicy({HWC_CONFIG_ID_60, {Fps(60), Fps(60)}}),
0);
- EXPECT_EQ(KernelIdleTimerAction::NoChange, refreshRateConfigs->getIdleTimerAction());
+ EXPECT_EQ(KernelIdleTimerAction::TurnOff, refreshRateConfigs->getIdleTimerAction());
// SetPolicy(90, 90), current 90Hz => TurnOff.
ASSERT_GE(refreshRateConfigs->setDisplayManagerPolicy({HWC_CONFIG_ID_90, {Fps(90), Fps(90)}}),