Merge "Add missing isShellUser check" into qt-dev

This commit is contained in:
TreeHugger Robot
2020-08-03 20:24:27 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {