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

Commit d3f88dd4 authored by Svetoslav's avatar Svetoslav Committed by Android Git Automerger
Browse files

am 80ce4ad6: Merge "Clear binder id after a permissions check before killing a UID." into mnc-dev

* commit '80ce4ad6':
  Clear binder id after a permissions check before killing a UID.
parents e9d5130f 80ce4ad6
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -11049,9 +11049,15 @@ public final class ActivityManagerService extends ActivityManagerNative
    public void killUid(int uid, String reason) {
        enforceCallingPermission(Manifest.permission.KILL_UID, "killUid");
        synchronized (this) {
            killPackageProcessesLocked(null, UserHandle.getAppId(uid), UserHandle.getUserId(uid),
                    ProcessList.FOREGROUND_APP_ADJ-1, false, true, true, false,
            final long identity = Binder.clearCallingIdentity();
            try {
                killPackageProcessesLocked(null, UserHandle.getAppId(uid),
                        UserHandle.getUserId(uid),
                        ProcessList.PERSISTENT_PROC_ADJ, false, true, true, true,
                        reason != null ? reason : "kill uid");
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }
    }