Dump DisplayModeDirector state without locking mSyncRoot
The current locking order of DisplayManagerGlobal.mLock,
DisplayManagerService.mSyncRoot and SensorObserver.mSensorObserverLock
may cause a deadlock when an EVENT_DISPLAY_CHANGED event is handled
by MediaRouter.Static and DMD.SensorObserver at the same time as
a DisplayManagerService dump is in progress.
The locking order of onDisplayChanged is:
- mSensorObserverLock -> DMG.mLock -> DMS.mSyncRoot
The locking order of DMS.dumpInternal is:
- DMS.mSyncRoot -> mSensorOberverLock
This change removes the mSyncRoot locking during the DMD dump to keep
the lock ordering from going in a cycle. DMD already guards its state
during a dump with its own class lock, so holding mSyncRoot is not
really necessary.
Bug: 202515175
Test: builds
Change-Id: I464e570e7107b49633e599b25ef1d208c9fc76aa
1 file changed