Merge "Add missing isShellUser check" into rvc-dev am: 455470d3b2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12099336

Change-Id: Ie38ba3aaa00b4e85058d8832f559825d22494e0e
This commit is contained in:
TreeHugger Robot
2020-07-30 20:25:41 +00:00
committed by Automerger Merge Worker

View File

@@ -3318,6 +3318,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) {