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

Commit 93b58152 authored by John Reck's avatar John Reck Committed by Anis Assi
Browse files

Add missing isShellUser check

Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
(cherry picked from commit 80a9cce4)
parent 01b0c8c3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3174,6 +3174,10 @@ public class ActivityManagerService extends IActivityManager.Stub
    @Override
    public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
            throws RemoteException {
        if (!isCallerShell()) {
            EventLog.writeEvent(0x534e4554, 160390416, Binder.getCallingUid(), "");
            throw new SecurityException("Only shell can call it");
        }
        synchronized (this) {
            final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel");
            if (app == null) {