2024-08-17 12:35:07 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-06-19 18:14:14 -04:00
|
|
|
From: Jing Ji <jji@google.com>
|
|
|
|
Date: Thu, 19 Oct 2023 14:22:58 -0700
|
|
|
|
Subject: [PATCH] DO NOT MERGE: Fix ActivityManager#killBackgroundProcesses
|
|
|
|
permissions
|
|
|
|
|
|
|
|
In the pevious CL, we incorrectly added the permission check in the
|
|
|
|
killBackgroundProcessesExcept. Now fix this issue.
|
|
|
|
|
|
|
|
Bug: 239423414
|
|
|
|
Bug: 223376078
|
|
|
|
Test: atest CtsAppTestCases:ActivityManagerTest
|
|
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:140fce861944419a375c669010c6c47cd7ff5b37)
|
|
|
|
Merged-In: I9471a77188ee63ec32cd0c81569193e4ccad885b
|
2024-08-05 16:03:46 -04:00
|
|
|
AOSP-Change-Id: I9471a77188ee63ec32cd0c81569193e4ccad885b
|
|
|
|
|
|
|
|
Change-Id: I1b1e683b6a92b0fa2a844a99bedcccac8c980e58
|
2024-06-19 18:14:14 -04:00
|
|
|
---
|
|
|
|
.../server/am/ActivityManagerService.java | 16 ----------------
|
|
|
|
1 file changed, 16 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
|
2024-08-17 12:35:07 -04:00
|
|
|
index bcb7276b4014..41b1ddaf887b 100644
|
2024-06-19 18:14:14 -04:00
|
|
|
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
|
|
|
|
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
|
2024-08-17 12:35:07 -04:00
|
|
|
@@ -4268,22 +4268,6 @@ public class ActivityManagerService extends IActivityManager.Stub
|
2024-06-19 18:14:14 -04:00
|
|
|
throw new SecurityException(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
- final int callingUid = Binder.getCallingUid();
|
|
|
|
- final int callingPid = Binder.getCallingPid();
|
|
|
|
-
|
|
|
|
- ProcessRecord proc;
|
|
|
|
- synchronized (mPidsSelfLocked) {
|
|
|
|
- proc = mPidsSelfLocked.get(callingPid);
|
|
|
|
- }
|
|
|
|
- if (callingUid >= FIRST_APPLICATION_UID
|
|
|
|
- && (proc == null || !proc.info.isSystemApp())) {
|
|
|
|
- final String msg = "Permission Denial: killAllBackgroundProcesses() from pid="
|
|
|
|
- + callingPid + ", uid=" + callingUid + " is not allowed";
|
|
|
|
- Slog.w(TAG, msg);
|
|
|
|
- // Silently return to avoid existing apps from crashing.
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
final long callingId = Binder.clearCallingIdentity();
|
|
|
|
try {
|
|
|
|
synchronized (this) {
|