Fix deadlock between PMS and AMS
Move reportComponentStateChanged() out of holding mLock to avoid
deadlock.
Symptom:
At thread 1,
PackageManagerService#setEnabledSettings held mLock
-> reportComponentStateChanged ...
--> AppOpsService#verifyAndGetBypass ask the this of AppOpsService
At thread 2,
Executor of AppOpsUidStateTrackerImpl held the this of AppOpsService
-> getPackagesForUid() ...
-->PackageManagerService#snapshotComputer ask mLock
Bug: 339045335
Bug: 340962640
Test: atest CtsPackageManagerTestCases
Change-Id: I7238a779202daceb3f2d69ced20ce41c7d1749c2
1 file changed