SF: Break dependency between VsyncConfiguration and RefreshRateConfigs

The VsyncConfiguration class doesn't need to know the list of
supported refresh rates, because the offsets can be calculated
and cached on the fly. This is better because the list of refresh
rates can change during runtime (for example for Android TV).

After fixing this the dependency on RefreshRateConfigs is only needed
for getting the current refresh rate at construction time. For
this it's sufficient to pass only the Fps instead of the whole
RefreshRateConfigs object.

Bug: 159590486
Test: presubmit
Change-Id: I1c0ceaf2524b517e85c8067577fc9f5146f1f632
diff --git a/services/surfaceflinger/tests/unittests/VsyncConfigurationTest.cpp b/services/surfaceflinger/tests/unittests/VsyncConfigurationTest.cpp
index 2a35f69..bb7578d 100644
--- a/services/surfaceflinger/tests/unittests/VsyncConfigurationTest.cpp
+++ b/services/surfaceflinger/tests/unittests/VsyncConfigurationTest.cpp
@@ -19,6 +19,7 @@
 
 #include <gmock/gmock.h>
 #include <log/log.h>
+#include <chrono>
 #include <thread>
 
 #include "Scheduler/VsyncConfiguration.h"
@@ -27,14 +28,15 @@
 
 namespace android::scheduler {
 
+using namespace std::chrono_literals;
+
 class TestableWorkDuration : public impl::WorkDuration {
 public:
     TestableWorkDuration(Fps currentFps, nsecs_t sfDuration, nsecs_t appDuration,
                          nsecs_t sfEarlyDuration, nsecs_t appEarlyDuration,
                          nsecs_t sfEarlyGlDuration, nsecs_t appEarlyGlDuration)
-          : impl::WorkDuration({Fps(60.0f), Fps(90.0f)}, currentFps, sfDuration, appDuration,
-                               sfEarlyDuration, appEarlyDuration, sfEarlyGlDuration,
-                               appEarlyGlDuration) {}
+          : impl::WorkDuration(currentFps, sfDuration, appDuration, sfEarlyDuration,
+                               appEarlyDuration, sfEarlyGlDuration, appEarlyGlDuration) {}
 };
 
 class WorkDurationTest : public testing::Test {
@@ -171,9 +173,9 @@
                          std::optional<nsecs_t> highFpsEarlyAppOffsetNs,
                          std::optional<nsecs_t> highFpsEarlyGpuAppOffsetNs,
                          nsecs_t thresholdForNextVsync)
-          : impl::PhaseOffsets({Fps(60.0f), Fps(90.0f)}, Fps(60.0f), vsyncPhaseOffsetNs,
-                               sfVSyncPhaseOffsetNs, earlySfOffsetNs, earlyGpuSfOffsetNs,
-                               earlyAppOffsetNs, earlyGpuAppOffsetNs, highFpsVsyncPhaseOffsetNs,
+          : impl::PhaseOffsets(Fps(60.0f), vsyncPhaseOffsetNs, sfVSyncPhaseOffsetNs,
+                               earlySfOffsetNs, earlyGpuSfOffsetNs, earlyAppOffsetNs,
+                               earlyGpuAppOffsetNs, highFpsVsyncPhaseOffsetNs,
                                highFpsSfVSyncPhaseOffsetNs, highFpsEarlySfOffsetNs,
                                highFpsEarlyGpuSfOffsetNs, highFpsEarlyAppOffsetNs,
                                highFpsEarlyGpuAppOffsetNs, thresholdForNextVsync) {}