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

Commit 49fd4508 authored by Hui Yu's avatar Hui Yu Committed by Android (Google) Code Review
Browse files

Merge "Remove one foregrond service restriction."

parents dcbb6de0 3f7a6d93
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -1439,7 +1439,6 @@ public final class OomAdjuster {
        }

        int capabilityFromFGS = 0; // capability from foreground service.
        boolean procStateFromFGSClient = false;
        for (int is = app.services.size() - 1;
                is >= 0 && (adj > ProcessList.FOREGROUND_APP_ADJ
                        || schedGroup == ProcessList.SCHED_GROUP_BACKGROUND
@@ -1562,10 +1561,6 @@ public final class OomAdjuster {
                            continue;
                        }

                        if (clientProcState == PROCESS_STATE_FOREGROUND_SERVICE) {
                            procStateFromFGSClient = true;
                        }

                        if (cr.hasFlag(Context.BIND_INCLUDE_CAPABILITIES)) {
                            capability |= client.curCapability;
                        }
@@ -2013,12 +2008,9 @@ public final class OomAdjuster {
        } else if (!ActivityManager.isProcStateBackground(procState)) {
            // procState higher than PROCESS_STATE_BOUND_FOREGROUND_SERVICE implicitly has
            // camera/microphone capability
            if (procState == PROCESS_STATE_FOREGROUND_SERVICE && procStateFromFGSClient) {
                // if the FGS state is passed down from client, do not grant implicit capabilities.
            } else {
            //TODO: remove this line when enforcing the feature.
            capability |= PROCESS_CAPABILITY_ALL_IMPLICIT;
        }
        }

        // TOP process has all capabilities.
        if (procState <= PROCESS_STATE_TOP) {