statsd: Add BatteryCycleCount atom
The health HAL specifies a charge cycles path that currently has no
atoms allocated to it. This change will allow statsd to collect this
information. I also ran 'clang-format -i --style=file' on this file.
Bug: 120680509
Test: cts-tradefed run singleCommand cts-dev -m CtsStatsdHostTestCases \
-t android.cts.statsd.atom.HostAtomTests#testBatteryCycleCount
Test: adb shell cmd stats pull-source 10045
Change-Id: I796b275c5d6880e9d7ec5bc468b55d7dc421ac78
Signed-off-by: Maggie White <maggiewhite@google.com>
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index f06914f..66127c9 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -244,6 +244,7 @@
ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
BatteryLevel battery_level = 10043;
BuildInformation build_information = 10044;
+ BatteryCycleCount battery_cycle_count = 10045;
}
// DO NOT USE field numbers above 100,000 in AOSP.
@@ -2487,6 +2488,19 @@
optional int32 time_to_inactive_secs = 5;
};
+/**
+ * Logs total effective full charge and discharge cycles on a battery.
+ * Here are some examples of one effective cycle:
+ * 1) the battery charges from 0% to 100% and drains back to 0%,
+ * 2) charging from 50% to 100% and draining back to 50% twice.
+ * Pulled from:
+ * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
+ */
+message BatteryCycleCount {
+ /* Number of total charge and discharge cycles on the system battery. */
+ optional int32 cycle_count = 1;
+}
+
/*
* Logs when a connection becomes available and lost.
* Logged in StatsCompanionService.java