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

Commit 80ce4ad6 authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

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

parents bcbe9ba0 0507d6b8
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);
            }
        }
    }