getSupportedRefreshRates same as legacy on MRR

For MRR devices,
change the getSupportedRefreshRates logic to return the same refresh
rates as what would be seen in the getSupportedRefreshRatesLegacy API.

This is ensures the CTS will pass.

Test: run cts-on-gsi -m CtsDisplayTestCases -t android.display.cts.DisplayTest#testGetSupportedRefreshRates
Test: cts on git_main
Bug: 401485115
Bug: 384427341
Flag: EXEMPT BUG_FIX
Change-Id: Iab15c2804932785fed8e40fb7331b4ae8ea9de66
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0029bfc..da12f5e 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1265,7 +1265,17 @@
     ui::FrameRateCategoryRate frameRateCategoryRate(normal.getValue(), high.getValue());
     info->frameRateCategoryRate = frameRateCategoryRate;
 
-    info->supportedRefreshRates = display->refreshRateSelector().getSupportedFrameRates();
+    if (info->hasArrSupport) {
+        info->supportedRefreshRates = display->refreshRateSelector().getSupportedFrameRates();
+    } else {
+        // On non-ARR devices, list the refresh rates same as the supported display modes.
+        std::vector<float> supportedFrameRates;
+        supportedFrameRates.reserve(info->supportedDisplayModes.size());
+        std::transform(info->supportedDisplayModes.begin(), info->supportedDisplayModes.end(),
+                       std::back_inserter(supportedFrameRates),
+                       [](ui::DisplayMode mode) { return mode.peakRefreshRate; });
+        info->supportedRefreshRates = supportedFrameRates;
+    }
     info->activeColorMode = display->getCompositionDisplay()->getState().colorMode;
     info->hdrCapabilities = filterOut4k30(display->getHdrCapabilities());