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

Commit 455470d3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add missing isShellUser check" into rvc-dev

parents 5ce7da37 bfdb7121
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -3318,6 +3318,10 @@ public class ActivityManagerService extends IActivityManager.Stub
    @Override
    @Override
    public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
    public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
            throws RemoteException {
            throws RemoteException {
        if (!isCallerShell()) {
            EventLog.writeEvent(0x534e4554, 160390416, Binder.getCallingUid(), "");
            throw new SecurityException("Only shell can call it");
        }
        synchronized (this) {
        synchronized (this) {
            final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel");
            final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel");
            if (app == null) {
            if (app == null) {