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

Commit 24607985 authored by Rafal Slawik's avatar Rafal Slawik Committed by Carlos Galo
Browse files

Cleanup: remove logging of LMK_STAT_STATE_CHANGED

Logging from lmkd was removed in https://r.android.com/2596772. The enum value was reused http://ag/24008439 for new functionality, so it triggers wrong code.

Test: m
Bug: 278174420
Change-Id: I9cb73f41cebda7051bd54606ea72ce3e71410915
Merged-In: I9cb73f41cebda7051bd54606ea72ce3e71410915
parent 4f490c58
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ public final class LmkdStatsReporter {
    static final String TAG = TAG_WITH_CLASS_NAME ? "LmkdStatsReporter" : TAG_AM;

    public static final int KILL_OCCURRED_MSG_SIZE = 80;
    public static final int STATE_CHANGED_MSG_SIZE = 8;

    private static final int PRESSURE_AFTER_KILL = 0;
    private static final int NOT_RESPONDING = 1;
@@ -80,16 +79,6 @@ public final class LmkdStatsReporter {
        }
    }

    /**
     * Processes the LMK_STATE_CHANGED packet
     * Logs the change in LMKD state which is used as start/stop boundaries for logging
     * LMK_KILL_OCCURRED event.
     * Code: LMK_STATE_CHANGED = 54
     */
    public static void logStateChanged(int state) {
        FrameworkStatsLog.write(FrameworkStatsLog.LMK_STATE_CHANGED, state);
    }

    private static int mapKillReason(int reason) {
        switch (reason) {
            case PRESSURE_AFTER_KILL:
+1 −10
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ public final class ProcessList {
    // LMK_PROCKILL
    // LMK_UPDATE_PROPS
    // LMK_KILL_OCCURRED
    // LMK_STATE_CHANGED
    // LMK_START_MONITORING
    static final byte LMK_TARGET = 0;
    static final byte LMK_PROCPRIO = 1;
    static final byte LMK_PROCREMOVE = 2;
@@ -359,7 +359,6 @@ public final class ProcessList {
    static final byte LMK_PROCKILL = 6; // Note: this is an unsolicited command
    static final byte LMK_UPDATE_PROPS = 7;
    static final byte LMK_KILL_OCCURRED = 8; // Msg to subscribed clients on kill occurred event
    static final byte LMK_STATE_CHANGED = 9; // Msg to subscribed clients on state changed
    static final byte LMK_START_MONITORING = 9; // Start monitoring if delayed earlier

    // Low Memory Killer Daemon command codes.
@@ -960,14 +959,6 @@ public final class ProcessList {
                                                foregroundServices.first,
                                                foregroundServices.second);
                                        return true;
                                    case LMK_STATE_CHANGED:
                                        if (receivedLen
                                                != LmkdStatsReporter.STATE_CHANGED_MSG_SIZE) {
                                            return false;
                                        }
                                        final int state = inputData.readInt();
                                        LmkdStatsReporter.logStateChanged(state);
                                        return true;
                                    default:
                                        return false;
                                }