summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hui Yu <huiyu@google.com> 2022-08-25 17:27:25 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-08-25 17:27:25 +0000
commit3173369c83040d6ee4d5f89e005886af5a08c350 (patch)
tree79b7e063bc165850a28112f08bd4b1bb94992590
parent5b09eef209031e4e8c570785604067c35fe3d71e (diff)
parent9024979aafab94ec22b4db89ff117a7abc26fd7b (diff)
Merge "Remove implicit process capability for certain foreground service state."
-rw-r--r--services/core/java/com/android/server/am/OomAdjuster.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 12aa66b84d85..de28be009c24 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -17,7 +17,6 @@
package com.android.server.am;
import static android.app.ActivityManager.PROCESS_CAPABILITY_ALL;
-import static android.app.ActivityManager.PROCESS_CAPABILITY_ALL_IMPLICIT;
import static android.app.ActivityManager.PROCESS_CAPABILITY_FOREGROUND_CAMERA;
import static android.app.ActivityManager.PROCESS_CAPABILITY_FOREGROUND_LOCATION;
import static android.app.ActivityManager.PROCESS_CAPABILITY_FOREGROUND_MICROPHONE;
@@ -2566,16 +2565,10 @@ public class OomAdjuster {
case PROCESS_STATE_BOUND_TOP:
return PROCESS_CAPABILITY_NETWORK;
case PROCESS_STATE_FOREGROUND_SERVICE:
- if (psr.hasForegroundServices()) {
- // Capability from FGS are conditional depending on foreground service type in
- // manifest file and the mAllowWhileInUsePermissionInFgs flag.
- return PROCESS_CAPABILITY_NETWORK;
- } else {
- // process has no FGS, the PROCESS_STATE_FOREGROUND_SERVICE is from client.
- // the implicit capability could be removed in the future, client should use
- // BIND_INCLUDE_CAPABILITY flag.
- return PROCESS_CAPABILITY_ALL_IMPLICIT | PROCESS_CAPABILITY_NETWORK;
- }
+ // Capability from foreground service is conditional depending on
+ // foregroundServiceType in the manifest file and the
+ // mAllowWhileInUsePermissionInFgs flag.
+ return PROCESS_CAPABILITY_NETWORK;
case PROCESS_STATE_BOUND_FOREGROUND_SERVICE:
return PROCESS_CAPABILITY_NETWORK;
default: