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

Skip to content
Commit a9b535f8 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

Fix inconsistent behavior of killPackageDependents.

ActivityManagerService.killPackageDependents behaved inconsistently when
used with USER_ALL vs a specific user id. In both cases, processes that
have added a dependency on the specified package via
addPackageDependency were killed as expected, but processes owned by the
specified package were only being killed when a specific user id was
used, and were left alone when USER_ALL was specified.

Fix this by looping over all the users as other similar process-killing
methods do, instead of relying on a single call to
killPackageProcessesLSP.

This also adds proper usage of UserController.handleIncomingUser, making
it possible to use the API with USER_CURRENT. Killing dependents for all
users now requires INTERACT_ACROSS_USERS_FULL to be consistent with
other similar APIs - previously no permission other than KILL_UID was
required.

Bug: 310653407
Test: atest CtsAppTestCases:PackageDependencyTest
Flag: EXEMPT bugfix
Change-Id: I7a95758bab4fa2c8b33d5c6748a614848c9d8d9a
parent af00cc73
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