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

Commit 182cc96a authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/cm-14.1' into v1-nougat

parents 6d813ea7 10c01c2f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4306,8 +4306,17 @@ public final class ActivityManagerService extends ActivityManagerNative
        return procState;
    }
    private boolean isCallerShell() {
        final int callingUid = Binder.getCallingUid();
        return callingUid == Process.SHELL_UID || callingUid == Process.ROOT_UID;
    }
    @Override
    public boolean setProcessMemoryTrimLevel(String process, int userId, int level) {
        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) {