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

Commit 6b6c292e authored by Nicholas Sauer's avatar Nicholas Sauer Committed by android-build-merger
Browse files

Merge "Invoke updateSharedUserPermsLPw for all users when a package is...

Merge "Invoke updateSharedUserPermsLPw for all users when a package is removed." into qt-qpr1-dev am: 4feb4522
am: bef2c22e

Change-Id: I9a863e8b54fb5b17cfc2dd8028f62fafe3cd39a4
parents da20ead3 bef2c22e
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -18017,19 +18017,20 @@ public class PackageManagerService extends IPackageManager.Stub
                        // or packages running under the shared user of the removed
                        // package if revoking the permissions requested only by the removed
                        // package is successful and this causes a change in gids.
                        boolean shouldKill = false;
                        for (int userId : UserManagerService.getInstance().getUserIds()) {
                            final int userIdToKill = mSettings.updateSharedUserPermsLPw(deletedPs,
                                    userId);
                            if (userIdToKill == UserHandle.USER_ALL
                                    || userIdToKill >= UserHandle.USER_SYSTEM) {
                                // If gids changed for this user, kill all affected packages.
                            shouldKill |= userIdToKill == UserHandle.USER_ALL
                                    || userIdToKill >= UserHandle.USER_SYSTEM;
                        }
                        // If gids changed, kill all affected packages.
                        if (shouldKill) {
                            mHandler.post(() -> {
                                // This has to happen with no lock held.
                                killApplication(deletedPs.name, deletedPs.appId,
                                        KILL_APP_REASON_GIDS_CHANGED);
                            });
                                break;
                            }
                        }
                    }
                    clearPackagePreferredActivitiesLPw(