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

Commit 03b6e853 authored by Jing Ji's avatar Jing Ji
Browse files

Remove the redundant capability changes from process change event

As the current IProcessObserver doesn't really use that, yet
the capability change events are emitted very frequently.

Bug: 285012835
Test: Treehugger
Change-Id: Ie2177138d1073dddfa1b760d5c844f213655d666
parent d28b311a
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1489,12 +1489,10 @@ public class ActivityManagerService extends IActivityManager.Stub
    static final class ProcessChangeItem {
        static final int CHANGE_ACTIVITIES = 1<<0;
        static final int CHANGE_FOREGROUND_SERVICES = 1<<1;
        static final int CHANGE_CAPABILITY = 1<<2;
        int changes;
        int uid;
        int pid;
        int processState;
        int capability;
        boolean foregroundActivities;
        int foregroundServiceTypes;
    }
+1 −3
Original line number Diff line number Diff line
@@ -3188,7 +3188,6 @@ public class OomAdjuster {
        }

        if (state.getCurCapability() != state.getSetCapability()) {
            changes |= ActivityManagerService.ProcessChangeItem.CHANGE_CAPABILITY;
            state.setSetCapability(state.getCurCapability());
        }

@@ -3212,13 +3211,12 @@ public class OomAdjuster {
                    mProcessList.enqueueProcessChangeItemLocked(app.getPid(), app.info.uid);
            item.changes |= changes;
            item.foregroundActivities = state.hasRepForegroundActivities();
            item.capability = state.getSetCapability();
            if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG_PROCESS_OBSERVERS,
                    "Item " + Integer.toHexString(System.identityHashCode(item))
                            + " " + app.toShortString() + ": changes=" + item.changes
                            + " foreground=" + item.foregroundActivities
                            + " type=" + state.getAdjType() + " source=" + state.getAdjSource()
                            + " target=" + state.getAdjTarget() + " capability=" + item.capability);
                            + " target=" + state.getAdjTarget());
        }

        if (state.isCached() && !state.shouldNotKillOnBgRestrictedAndIdle()) {