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

Skip to content
Commit 5395814a authored by Yasin Kilicdere's avatar Yasin Kilicdere
Browse files

Move removeUserWithProfilesUnchecked outside of mPackagesLock.

In UserManagerService.removeUserWhenPossible we're first trying to
remove the user immediately by calling removeUserWithProfilesUnchecked
or otherwise marking it as ephemeral. In that flow if the user's type
is a profile, we're calling sendProfileRemovedBroadcast inside
removeUserUnchecked method. Which requires an ActivityManager lock and
shouldn't be called while holding PackageManager lock, or it might
cause a deadlock.

This CL moves that call outside of mPackagesLock to prevent such a
deadlock possibility.

And also deduplicates the user removal validation logic into
getUserRemovabilityLocked.

Bug: 269077555
Test: atest com.android.server.pm.UserManagerTest
Change-Id: I46a1675fe181892eac3fba6625ff49adb60441bb
parent 2d57bcbf
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