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

Commit 9b2199bd authored by Bookatz's avatar Bookatz Committed by Adam Bookatz
Browse files

Wean Statsd off BatteryStats: WakeupAlarm

Statsd calls were sometimes made from BatteryStats, instead of directly
from the source, as a way of getting it running quickly in P. These must
now be done properly and separately.
Note that Statsd needs to be independent of BatteryStats, in preparation
for deprecating large parts of BatteryStats.

Bug: 80308558
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Change-Id: I9e10672dd701adfbdd5a296c909e44fb17824cd1
parent d888df2b
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -4258,8 +4258,6 @@ public class BatteryStatsImpl extends BatteryStats {
                            workSourceName != null ? workSourceName : packageName);
                    pkg.noteWakeupAlarmLocked(tag);
                }
                StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, workSource.get(i),
                        workSource.getName(i), tag);
            }
            ArrayList<WorkChain> workChains = workSource.getWorkChains();
@@ -4272,7 +4270,6 @@ public class BatteryStatsImpl extends BatteryStats {
                        BatteryStatsImpl.Uid.Pkg pkg = getPackageStatsLocked(uid, packageName);
                        pkg.noteWakeupAlarmLocked(tag);
                    }
                    StatsLog.write(StatsLog.WAKEUP_ALARM_OCCURRED, wc.getUids(), wc.getTags(), tag);
                }
            }
        } else {
@@ -4280,7 +4277,6 @@ public class BatteryStatsImpl extends BatteryStats {
                BatteryStatsImpl.Uid.Pkg pkg = getPackageStatsLocked(uid, packageName);
                pkg.noteWakeupAlarmLocked(tag);
            }
            StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, uid, null, tag);
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -14561,6 +14561,11 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
        mBatteryStatsService.noteWakupAlarm(sourcePkg, sourceUid, workSource, tag);
        if (workSource != null) {
            StatsLog.write(StatsLog.WAKEUP_ALARM_OCCURRED, workSource, tag);
        } else {
            StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, sourceUid, null, tag);
        }
    }
    @Override