FrameRateCategory::NoPreference votes Min

LayerVoteType::Min is a vote type that is ignored unless all voting
active layers also vote Min for minimum refresh rate.
Now the NoPreference category works for
infrequent animations such as a blinking cursor.

Bug: 298716564
Test: atest CtsSurfaceControlTestsStaging
Test: atest libsurfaceflinger_unittest
Change-Id: I970d59ff6499b9d64962361f3098d19b6b953d9c
diff --git a/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp b/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
index 7e77bbe..be28e98 100644
--- a/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
+++ b/services/surfaceflinger/Scheduler/RefreshRateSelector.cpp
@@ -501,6 +501,12 @@
                 break;
             case LayerVoteType::ExplicitCategory:
                 explicitCategoryVoteLayers++;
+                if (layer.frameRateCategory == FrameRateCategory::NoPreference) {
+                    // Count this layer for Min vote as well. The explicit vote avoids
+                    // touch boost and idle for choosing a category, while Min vote is for correct
+                    // behavior when all layers are Min or no vote.
+                    minVoteLayers++;
+                }
                 break;
             case LayerVoteType::Heuristic:
                 break;