Merge "powerstats: add AoC restart count stats" am: 7dd7e93a03 am: 225dd70fe3

Original change: https://android-review.googlesource.com/c/device/google/gs101/+/2044845

Change-Id: I505f8088328b950ab7dc40823f90c0f6b2ad8c8f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/powerstats/Gs101CommonDataProviders.cpp b/powerstats/Gs101CommonDataProviders.cpp
index e156b7b..f1e3aa5 100644
--- a/powerstats/Gs101CommonDataProviders.cpp
+++ b/powerstats/Gs101CommonDataProviders.cpp
@@ -79,6 +79,23 @@
     };
     p->addStateResidencyDataProvider(
             std::make_unique<AocStateResidencyDataProvider>(monitorIds, monitorStates));
+
+    // Add AoC restart count
+    const GenericStateResidencyDataProvider::StateResidencyConfig restartCountConfig = {
+            .entryCountSupported = true,
+            .entryCountPrefix = "",
+            .totalTimeSupported = false,
+            .lastEntrySupported = false,
+    };
+    const std::vector<std::pair<std::string, std::string>> restartCountHeaders = {
+            std::make_pair("RESTART", ""),
+    };
+    std::vector<GenericStateResidencyDataProvider::PowerEntityConfig> cfgs;
+    cfgs.emplace_back(
+            generateGenericStateResidencyConfigs(restartCountConfig, restartCountHeaders),
+            "AoC-Count", "");
+    p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
+            "/sys/devices/platform/19000000.aoc/restart_count", cfgs));
 }
 
 void addDvfsStats(std::shared_ptr<PowerStats> p) {