SF: Obey active display's RefreshRateSelector
When a display becomes active, apply its RefreshRateSelector's policy,
as it may have changed while the display was inactive.
When booting while folded, DisplayManager first sends DisplayModeSpecs
for each display, and then powers on the outer display. Before this CL,
the outer display would become the new active/leader display, but its
DisplayManagerPolicy would never be applied.
Also, remove calls during boot (or restart) that are now redundant given
that onActiveDisplayChangedLocked is called when powering on the primary
display in onInitializeDisplays.
Bug: 250421145
Test: Force 120 Hz, and reboot while folded.
Test: Apply Ifaa46027bad8ff0945db9da5c30f2f31b6c8d10c and repeat.
Change-Id: I15e0f5a280e62baf6d4e6ea2748d95342e79ac44
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 7c0926a..8776904 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -666,6 +666,11 @@
const sp<DisplayDevice>&, const scheduler::RefreshRateSelector::PolicyVariant&)
EXCLUDES(mStateLock) REQUIRES(kMainThreadContext);
+ // TODO(b/241285191): Look up RefreshRateSelector on Scheduler to remove redundant parameter.
+ status_t applyRefreshRateSelectorPolicy(PhysicalDisplayId,
+ const scheduler::RefreshRateSelector&)
+ REQUIRES(mStateLock, kMainThreadContext);
+
void commitTransactions() EXCLUDES(mStateLock) REQUIRES(kMainThreadContext);
void commitTransactionsLocked(uint32_t transactionFlags)
REQUIRES(mStateLock, kMainThreadContext);