SF: Use default minimal refresh rate between frames

When calculating duplicate frames make sure the minimal period
is at least Fps(120).toPeriodNsecs(). It's not okay to use
min period equal to the max refresh rate at layer creation,
because the supported refresh rates can change. E.g. initially
it can be 24hz and later (bacause another display is plugged)
it can be 60hz, which will cause a lot of frames to be considered
as duplicates.

Bug: 159590486
Test: presubmit
Change-Id: I4424c05012925273ed6ea8254fb975bf8fe7d058
diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp
index e5644c4..ab8bff1 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.cpp
+++ b/services/surfaceflinger/Scheduler/Scheduler.cpp
@@ -551,23 +551,19 @@
 void Scheduler::registerLayer(Layer* layer) {
     if (!mLayerHistory) return;
 
-    const auto maxFps = mRefreshRateConfigs.getMaxRefreshRate().getFps();
-
     if (layer->getWindowType() == InputWindowInfo::Type::STATUS_BAR) {
-        mLayerHistory->registerLayer(layer, maxFps, scheduler::LayerHistory::LayerVoteType::NoVote);
+        mLayerHistory->registerLayer(layer, scheduler::LayerHistory::LayerVoteType::NoVote);
     } else if (!mOptions.useContentDetection) {
         // If the content detection feature is off, all layers are registered at Max. We still keep
         // the layer history, since we use it for other features (like Frame Rate API), so layers
         // still need to be registered.
-        mLayerHistory->registerLayer(layer, maxFps, scheduler::LayerHistory::LayerVoteType::Max);
+        mLayerHistory->registerLayer(layer, scheduler::LayerHistory::LayerVoteType::Max);
     } else {
         if (layer->getWindowType() == InputWindowInfo::Type::WALLPAPER) {
             // Running Wallpaper at Min is considered as part of content detection.
-            mLayerHistory->registerLayer(layer, maxFps,
-                                         scheduler::LayerHistory::LayerVoteType::Min);
+            mLayerHistory->registerLayer(layer, scheduler::LayerHistory::LayerVoteType::Min);
         } else {
-            mLayerHistory->registerLayer(layer, maxFps,
-                                         scheduler::LayerHistory::LayerVoteType::Heuristic);
+            mLayerHistory->registerLayer(layer, scheduler::LayerHistory::LayerVoteType::Heuristic);
         }
     }
 }