powerstats: Move NFC stats to device specific

Bug: 184722506
Test: dumpsys android.hardware.power.stats.IPowerStats/default
Change-Id: I99b82c52d0dee1cf3b7eda7e4985d9b40db162d0
diff --git a/powerstats/Gs101CommonDataProviders.cpp b/powerstats/Gs101CommonDataProviders.cpp
index 8f4b5d0..b62262a 100644
--- a/powerstats/Gs101CommonDataProviders.cpp
+++ b/powerstats/Gs101CommonDataProviders.cpp
@@ -530,29 +530,6 @@
             EnergyConsumerType::GNSS, "GPS", {"L9S_GNSS_CORE"}));
 }
 
-void addNFC(std::shared_ptr<PowerStats> p) {
-    const GenericStateResidencyDataProvider::StateResidencyConfig nfcStateConfig = {
-        .entryCountSupported = true,
-        .entryCountPrefix = "Cumulative count:",
-        .totalTimeSupported = true,
-        .totalTimePrefix = "Cumulative duration msec:",
-        .lastEntrySupported = true,
-        .lastEntryPrefix = "Last entry timestamp msec:",
-    };
-    const std::vector<std::pair<std::string, std::string>> nfcStateHeaders = {
-        std::make_pair("IDLE", "Idle mode:"),
-        std::make_pair("ACTIVE", "Active mode:"),
-        std::make_pair("ACTIVE-RW", "Active Reader/Writer mode:"),
-    };
-
-    std::vector<GenericStateResidencyDataProvider::PowerEntityConfig> cfgs;
-    cfgs.emplace_back(generateGenericStateResidencyConfigs(nfcStateConfig, nfcStateHeaders),
-            "NFC", "NFC subsystem");
-
-    p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
-            "/sys/devices/platform/10960000.hsi2c/i2c-3/3-0008/power_stats", cfgs));
-}
-
 void addPCIe(std::shared_ptr<PowerStats> p) {
     // Add PCIe power entities for Modem and WiFi
     const GenericStateResidencyDataProvider::StateResidencyConfig pcieStateConfig = {
@@ -702,7 +679,6 @@
     addGPU(p);
     addMobileRadio(p);
     addGNSS(p);
-    addNFC(p);
     addPCIe(p);
     addWifi(p);
     addUfs(p);
@@ -713,3 +689,26 @@
     // Remove this when Wifi/BT energy consumption models are available or revert before ship
     addPlaceholderEnergyConsumers(p);
 }
+
+void addNFC(std::shared_ptr<PowerStats> p, const std::string& path) {
+    const GenericStateResidencyDataProvider::StateResidencyConfig nfcStateConfig = {
+        .entryCountSupported = true,
+        .entryCountPrefix = "Cumulative count:",
+        .totalTimeSupported = true,
+        .totalTimePrefix = "Cumulative duration msec:",
+        .lastEntrySupported = true,
+        .lastEntryPrefix = "Last entry timestamp msec:",
+    };
+    const std::vector<std::pair<std::string, std::string>> nfcStateHeaders = {
+        std::make_pair("IDLE", "Idle mode:"),
+        std::make_pair("ACTIVE", "Active mode:"),
+        std::make_pair("ACTIVE-RW", "Active Reader/Writer mode:"),
+    };
+
+    std::vector<GenericStateResidencyDataProvider::PowerEntityConfig> cfgs;
+    cfgs.emplace_back(generateGenericStateResidencyConfigs(nfcStateConfig, nfcStateHeaders),
+            "NFC", "NFC subsystem");
+
+    p->addStateResidencyDataProvider(std::make_unique<GenericStateResidencyDataProvider>(
+            path, cfgs));
+}
diff --git a/powerstats/include/Gs101CommonDataProviders.h b/powerstats/include/Gs101CommonDataProviders.h
index 983650c..98e6953 100644
--- a/powerstats/include/Gs101CommonDataProviders.h
+++ b/powerstats/include/Gs101CommonDataProviders.h
@@ -21,3 +21,5 @@
 using aidl::android::hardware::power::stats::PowerStats;
 
 void addGs101CommonDataProviders(std::shared_ptr<PowerStats> p);
+
+void addNFC(std::shared_ptr<PowerStats> p, const std::string& path);