diff options
| author | 2020-07-06 16:10:49 -0700 | |
|---|---|---|
| committer | 2020-07-18 00:32:42 +0000 | |
| commit | 9c33b3fe919d9aa295e83f2ed78bad2b229314c1 (patch) | |
| tree | 10f7a57c5c9cf4a0d1ea3817a369b5ac5e05f627 | |
| parent | 1fac778d664c139273e496499a4d2b5bd196aa4f (diff) | |
Add missing isShellUser check
Bug: 160390416
Test: verified command still works from shell
Change-Id: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
Merged-In: I23bb06e00f1623e4f27c02d7eb2c0d273b40771b
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index ebf5068ca942..b3d52f46b332 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -4830,6 +4830,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) { |