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

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

am 62969048: am d3f88dd4: am 80ce4ad6: Merge "Clear binder id after a...

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

* commit '62969048':
  Clear binder id after a permissions check before killing a UID.
parents a658f52c 62969048
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -11050,9 +11050,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);
            }
        }
    }