Skip to content
Commit 6e11e049 authored by jorgegil@google.com's avatar jorgegil@google.com
Browse files

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
parent f23eb51d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment