Fix deadlock between PackageManager and DisplayManager
UpdateOwnershipHelper#readUpdateOwnerDenyList calls getResources()
that will call getDisplayMetrics. In DisplayMetrics() that needs to
access a lock in DisplayManagerGlobal. When calling this method
inside mPm.mLock, it may trigger the deadlock between PackageManager
and DisplayManager.
To fix this issue, try to get the denylist in the handler thread and
outside the mPm.mLock.
Bug: 305615356
Bug: 309422939
Test: manual. Add logs to make sure getResources() doesn't be called
inside mPm.mLock
Merged-in: I3dea7b1df6f115d7c1cffda6a9d51070a5d7dd80
Change-Id: Ic62aa8a41d9b4c2b1b145a80e334a865fc1fbef7
(cherry picked from commit 1e7589afb39cfe04f9f13a87e77a0ec479604a3f)
2 files changed