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

Commit caf2293e authored by Bookatz's avatar Bookatz
Browse files

Statsd atom: add packageName to wakeups

Wakeup alarms in batterystats are tracked by both uid and package name.
This is quite unique in batterystats - most things are only tracked by uid.
But, to make sure statsd gets all the same data, statsd now tracks wakeup
alarms' package name too.

Bug: 115686599
Test: UidAtomTests#testWakeupAlarm

Change-Id: I1d124faf207867e0ba70f19d89ff620b73ac5636
parent 810418e4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -753,6 +753,9 @@ message WakeupAlarmOccurred {

    // Name of the wakeup alarm.
    optional string tag = 2;

    // Name of source package (for historical reasons, since BatteryStats tracked it).
    optional string package_name = 3;
}

/**
+3 −2
Original line number Diff line number Diff line
@@ -9607,9 +9607,10 @@ public class ActivityManagerService extends IActivityManager.Stub
        mBatteryStatsService.noteWakupAlarm(sourcePkg, sourceUid, workSource, tag);
        if (workSource != null) {
            StatsLog.write(StatsLog.WAKEUP_ALARM_OCCURRED, workSource, tag);
            StatsLog.write(StatsLog.WAKEUP_ALARM_OCCURRED, workSource, tag, sourcePkg);
        } else {
            StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, sourceUid, null, tag);
            StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, sourceUid, null, tag,
                    sourcePkg);
        }
    }