powerstats: Add EnergyConsumer API

Also clean up rest of PowerStats HAL 2.0 API and type names

Bug: 168831183
Test: atest VtsHalPowerStatsTargetTest
Change-Id: I987f984bf717b107cf55213c7063ac9f310f8d54
diff --git a/powerstats/aidl/default/PowerStats.cpp b/powerstats/aidl/default/PowerStats.cpp
index 8d6a0ee..9f3e76e 100644
--- a/powerstats/aidl/default/PowerStats.cpp
+++ b/powerstats/aidl/default/PowerStats.cpp
@@ -23,27 +23,40 @@
 namespace hardware {
 namespace powerstats {
 
-ndk::ScopedAStatus PowerStats::getEnergyData(const std::vector<int32_t>& in_railIndices,
-                                             std::vector<EnergyData>* _aidl_return) {
-    (void)in_railIndices;
-    (void)_aidl_return;
-    return ndk::ScopedAStatus::ok();
-}
-
 ndk::ScopedAStatus PowerStats::getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) {
     (void)_aidl_return;
     return ndk::ScopedAStatus::ok();
 }
 
-ndk::ScopedAStatus PowerStats::getPowerEntityStateResidencyData(
+ndk::ScopedAStatus PowerStats::getPowerEntityStateResidency(
         const std::vector<int32_t>& in_powerEntityIds,
-        std::vector<PowerEntityStateResidencyResult>* _aidl_return) {
+        std::vector<StateResidencyResult>* _aidl_return) {
     (void)in_powerEntityIds;
     (void)_aidl_return;
     return ndk::ScopedAStatus::ok();
 }
 
-ndk::ScopedAStatus PowerStats::getRailInfo(std::vector<RailInfo>* _aidl_return) {
+ndk::ScopedAStatus PowerStats::getEnergyConsumerInfo(std::vector<EnergyConsumerId>* _aidl_return) {
+    (void)_aidl_return;
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus PowerStats::getEnergyConsumed(
+        const std::vector<EnergyConsumerId>& in_energyConsumerIds,
+        std::vector<EnergyConsumerResult>* _aidl_return) {
+    (void)in_energyConsumerIds;
+    (void)_aidl_return;
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus PowerStats::getEnergyMeterInfo(std::vector<ChannelInfo>* _aidl_return) {
+    (void)_aidl_return;
+    return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus PowerStats::readEnergyMeters(const std::vector<int32_t>& in_channelIds,
+                                                std::vector<EnergyMeasurement>* _aidl_return) {
+    (void)in_channelIds;
     (void)_aidl_return;
     return ndk::ScopedAStatus::ok();
 }
diff --git a/powerstats/aidl/default/PowerStats.h b/powerstats/aidl/default/PowerStats.h
index 49240cb..0007efa 100644
--- a/powerstats/aidl/default/PowerStats.h
+++ b/powerstats/aidl/default/PowerStats.h
@@ -26,13 +26,17 @@
 class PowerStats : public BnPowerStats {
   public:
     PowerStats() = default;
-    ndk::ScopedAStatus getEnergyData(const std::vector<int32_t>& in_railIndices,
-                                     std::vector<EnergyData>* _aidl_return) override;
+    // Methods from aidl::android::hardware::powerstats::IPowerStats
     ndk::ScopedAStatus getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) override;
-    ndk::ScopedAStatus getPowerEntityStateResidencyData(
+    ndk::ScopedAStatus getPowerEntityStateResidency(
             const std::vector<int32_t>& in_powerEntityIds,
-            std::vector<PowerEntityStateResidencyResult>* _aidl_return) override;
-    ndk::ScopedAStatus getRailInfo(std::vector<RailInfo>* _aidl_return) override;
+            std::vector<StateResidencyResult>* _aidl_return) override;
+    ndk::ScopedAStatus getEnergyConsumerInfo(std::vector<EnergyConsumerId>* _aidl_return) override;
+    ndk::ScopedAStatus getEnergyConsumed(const std::vector<EnergyConsumerId>& in_energyConsumerIds,
+                                         std::vector<EnergyConsumerResult>* _aidl_return) override;
+    ndk::ScopedAStatus getEnergyMeterInfo(std::vector<ChannelInfo>* _aidl_return) override;
+    ndk::ScopedAStatus readEnergyMeters(const std::vector<int32_t>& in_channelIds,
+                                        std::vector<EnergyMeasurement>* _aidl_return) override;
 };
 
 }  // namespace powerstats