Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c114f128 authored by Sam Dubey's avatar Sam Dubey
Browse files

Revert "Remove implicit process capability for certain foregroun..."

Revert submission 19562293-implicit_capability

Reason for revert: Breaking platinum tests
Bug: 243829830
Reverted Changes:
Icccab0ef0:Add test case testFgsDefaultCapabilityNone.
I586fafbfb:Remove implicit process capability for certain for...

Change-Id: Ifba582f8ed1733dd1525223142ea7943de141ab8
parent 9024979a
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
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;
@@ -2564,10 +2565,16 @@ public class OomAdjuster {
            case PROCESS_STATE_BOUND_TOP:
                return PROCESS_CAPABILITY_NETWORK;
            case PROCESS_STATE_FOREGROUND_SERVICE:
                // Capability from foreground service is conditional depending on
                // foregroundServiceType in the manifest file and the
                // mAllowWhileInUsePermissionInFgs flag.
                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;
                }
            case PROCESS_STATE_BOUND_FOREGROUND_SERVICE:
                return PROCESS_CAPABILITY_NETWORK;
            default: