Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c90d6c9 authored by ellen.yang's avatar ellen.yang Committed by TYM Tsai
Browse files

Fix deadlock between PMS and UMS

Move scheduleWritePackageRestrictions() out of holding mLock to avoid deadlock.

Symptom:

At thread 1,

PackageManagerService#snapshotComputer held mSnapshotLock ask mLock

At thread 2,

PackageManagerService#setEnabledSettings held mLock
-> scheduleWritePackageRestrictions -> UserManagerService#exists ...
--> UserManagerService#getUserInfoNoChecks ask mUsersLock of UserManagerService

At thread 3,

UserManagerService$LocalService#getProfileIdsExcludingHidden held mUsersLock
-> getProfileIdsLU -> isProfileHidden -> getUserPropertiesCopy -> hasManageUsersPermission ...
--> PackageManagerService#snapshotComputer ask mSnapshotLock

Bug: 411582851
Flag: EXEMPT bugfix
Test: atest CtsPackageInstallTestCases
Change-Id: I974719832d612249e43e837e27e9d6f64601a5fd
parent 168d2b61
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment