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

Commit 4503e10b authored by Tej Singh's avatar Tej Singh
Browse files

Atom: WifiMulticastLockStateChanged

Add WifiMulticastLockStateChanged to atoms.proto
Add log lines

Test: CTS test in accompanying CL
Change-Id: I9b4b861a2de5254c9b7f41c15ab0fbb76af4ff6e
parent ec8c2486
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ message Atom {
        AppStartFullyDrawnChanged app_start_fully_drawn_changed = 50;
        LmkEventOccurred lmk_event_occurred = 51;
        PictureInPictureStateChanged picture_in_picture_state_changed = 52;
        WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
        // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15.
    }

@@ -706,6 +707,22 @@ message WifiScanStateChanged {
    optional State state = 2;
}

/**
 * Logs wifi multicast locks held by an app
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 */
message WifiMulticastLockStateChanged {
    repeated AttributionNode attribution_node = 1;

    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 2;
}

/**
 * Logs phone signal strength changes.
 *
+4 −0
Original line number Diff line number Diff line
@@ -6947,6 +6947,8 @@ public class BatteryStatsImpl extends BatteryStats {
                            WIFI_MULTICAST_ENABLED, mBsi.mWifiMulticastTimers, mBsi.mOnBatteryTimeBase);
                }
                mWifiMulticastTimer.startRunningLocked(elapsedRealtimeMs);
                StatsLog.write_non_chained(
                        StatsLog.WIFI_MULTICAST_LOCK_STATE_CHANGED, getUid(), null, 1);
            }
        }
@@ -6955,6 +6957,8 @@ public class BatteryStatsImpl extends BatteryStats {
            if (mWifiMulticastEnabled) {
                mWifiMulticastEnabled = false;
                mWifiMulticastTimer.stopRunningLocked(elapsedRealtimeMs);
                StatsLog.write_non_chained(
                        StatsLog.WIFI_MULTICAST_LOCK_STATE_CHANGED, getUid(), null, 0);
            }
        }