Add shouldBeSeamless to setFrameRate
This CL adds a new parameter shouldBeSeamless to the existing
setFrameRate APIs. This parameter indicates whether the desired
refresh rate should be achieved only seamlessly or also switches
with visual interruptions for the user are allowed. The default
value of the new parameter is "true".
Test: atest RefreshRateConfigsTest
Test: atest SetFrameRateTest
Test: atest libsurfaceflinger_unittest
Test: atest libgui_test
Bug: 161776961
Change-Id: I0df16e09f77c8c198fd3733fb581a2aaadfed685
diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
index 8ff92a0..41e54a7 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
+++ b/services/surfaceflinger/Scheduler/RefreshRateConfigs.h
@@ -86,6 +86,8 @@
bool operator==(const RefreshRate& other) const { return !(*this != other); }
+ std::string toString() const;
+
private:
friend RefreshRateConfigs;
friend class RefreshRateConfigsTest;
@@ -216,6 +218,8 @@
LayerVoteType vote = LayerVoteType::NoVote;
// Layer's desired refresh rate, if applicable.
float desiredRefreshRate = 0.0f;
+ // If a seamless mode switch is required.
+ bool shouldBeSeamless = true;
// Layer's weight in the range of [0, 1]. The higher the weight the more impact this layer
// would have on choosing the refresh rate.
float weight = 0.0f;