Fix deadlock between PMS and UMS threads

Resolve circular waiting in PMS side. It holds mLock in
setEnabledSettings(), then calls
getComponentEnabledSettingInternal() -> UMS to ask mUsersLock.
To fix, move the method out of mLock block

Symptom:
PMS a: hold mSnapshotLock ->  ask PMS:mLock
PMS b: hold mLock         ->  ask UMS:mUsersLock
UMS: hold mUsersLock      ->  ask PMS:mSnapshotLock

Bug: 414214527
Flag: EXEMPT bug fix
Test: atest CtsPackageInstallTestCases
Test: atest CtsPackageManagerTestCases
Test: atest CtsPackageManagerStatsHostTestCases
Change-Id: Ibad1f72477bc5b04fc1df129f593dc087272f3ee
1 file changed