SF: Use VsyncSchedule's ID for EventThread
The existing code will take the first display that is hotplugged and set
it as the PhysicalDisplayId associated with the EventThread's future
vsync events. There isn't anything wrong with this in the current
implementation because SurfaceFlinger is careful about removing/adding
displays when pacesetter is changed.
The EventThread is already associated with a specific VsyncSchedule. The
VsyncSchedule already maintains the PhysicalDisplayId. Use that instead
and make the code slightly less fragile.
Bug: 352324977
Flag: EXEMPT refactor
Test: presubmit
Change-Id: I33d7da120289e5cf1127d783eae3011280bf65bd
diff --git a/services/surfaceflinger/Scheduler/VsyncSchedule.h b/services/surfaceflinger/Scheduler/VsyncSchedule.h
index 881d678..e63cbb2 100644
--- a/services/surfaceflinger/Scheduler/VsyncSchedule.h
+++ b/services/surfaceflinger/Scheduler/VsyncSchedule.h
@@ -112,6 +112,8 @@
bool getPendingHardwareVsyncState() const REQUIRES(kMainThreadContext);
+ PhysicalDisplayId getPhysicalDisplayId() const { return mId; }
+
protected:
using ControllerPtr = std::unique_ptr<VsyncController>;