power/stats: Add EnergyConsumer types
Also cleaning up Power Stats HAL type names to be less verbose
Bug: 176117316
Test: atest VtsHalPowerStatsTargetTest
Change-Id: I252a13b0490326ab9557f4a81ee313e57eb36754
Merged-In: I252a13b0490326ab9557f4a81ee313e57eb36754
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/Channel.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/Channel.aidl
new file mode 100644
index 0000000..ac326b5
--- /dev/null
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/Channel.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power.stats;
+@VintfStability
+parcelable Channel {
+ int id;
+ @utf8InCpp String name;
+}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/ChannelInfo.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/ChannelInfo.aidl
deleted file mode 100644
index 209bec4..0000000
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/ChannelInfo.aidl
+++ /dev/null
@@ -1,23 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.power.stats;
-@VintfStability
-parcelable ChannelInfo {
- int channelId;
- @utf8InCpp String channelName;
-}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumer.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumer.aidl
new file mode 100644
index 0000000..9f9a10b
--- /dev/null
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumer.aidl
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power.stats;
+@VintfStability
+parcelable EnergyConsumer {
+ int id;
+ int ordinal;
+ android.hardware.power.stats.EnergyConsumerType type;
+ @utf8InCpp String name;
+}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerAttribution.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerAttribution.aidl
index 0a7cff7..53f31b6 100644
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerAttribution.aidl
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerAttribution.aidl
@@ -2,13 +2,14 @@
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerId.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerId.aidl
deleted file mode 100644
index 7ca3b15..0000000
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerId.aidl
+++ /dev/null
@@ -1,23 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.power.stats;
-@Backing(type="int") @VintfStability
-enum EnergyConsumerId {
- DISPLAY = 0,
- GPS = 1,
-}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerResult.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerResult.aidl
index 815316e..773fa28 100644
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerResult.aidl
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerResult.aidl
@@ -2,13 +2,14 @@
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
@@ -18,7 +19,7 @@
package android.hardware.power.stats;
@VintfStability
parcelable EnergyConsumerResult {
- android.hardware.power.stats.EnergyConsumerId energyConsumerId;
+ int id;
long timestampMs;
long energyUWs;
android.hardware.power.stats.EnergyConsumerAttribution[] attribution;
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerType.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerType.aidl
new file mode 100644
index 0000000..d08d24e
--- /dev/null
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerType.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power.stats;
+@VintfStability
+enum EnergyConsumerType {
+ OTHER = 0,
+ CPU_CLUSTER = 1,
+ DISPLAY = 2,
+}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyMeasurement.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyMeasurement.aidl
index 4d56ccf..fc61c27 100644
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyMeasurement.aidl
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyMeasurement.aidl
@@ -2,13 +2,14 @@
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
@@ -18,7 +19,7 @@
package android.hardware.power.stats;
@VintfStability
parcelable EnergyMeasurement {
- int channelId;
+ int id;
long timestampMs;
long durationMs;
long energyUWs;
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/IPowerStats.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/IPowerStats.aidl
index 07013b0..11a2936 100644
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/IPowerStats.aidl
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/IPowerStats.aidl
@@ -2,13 +2,14 @@
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
@@ -18,10 +19,10 @@
package android.hardware.power.stats;
@VintfStability
interface IPowerStats {
- android.hardware.power.stats.PowerEntityInfo[] getPowerEntityInfo();
+ android.hardware.power.stats.PowerEntity[] getPowerEntityInfo();
android.hardware.power.stats.StateResidencyResult[] getStateResidency(in int[] powerEntityIds);
- android.hardware.power.stats.EnergyConsumerId[] getEnergyConsumerInfo();
- android.hardware.power.stats.EnergyConsumerResult[] getEnergyConsumed(in android.hardware.power.stats.EnergyConsumerId[] energyConsumerIds);
- android.hardware.power.stats.ChannelInfo[] getEnergyMeterInfo();
+ android.hardware.power.stats.EnergyConsumer[] getEnergyConsumerInfo();
+ android.hardware.power.stats.EnergyConsumerResult[] getEnergyConsumed(in int[] energyConsumerIds);
+ android.hardware.power.stats.Channel[] getEnergyMeterInfo();
android.hardware.power.stats.EnergyMeasurement[] readEnergyMeters(in int[] channelIds);
}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/PowerEntity.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/PowerEntity.aidl
new file mode 100644
index 0000000..8fff6c3
--- /dev/null
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/PowerEntity.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power.stats;
+@VintfStability
+parcelable PowerEntity {
+ int id;
+ @utf8InCpp String name;
+ android.hardware.power.stats.State[] states;
+}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/PowerEntityInfo.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/PowerEntityInfo.aidl
deleted file mode 100644
index 3b16362..0000000
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/PowerEntityInfo.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.power.stats;
-@VintfStability
-parcelable PowerEntityInfo {
- int powerEntityId;
- @utf8InCpp String powerEntityName;
- android.hardware.power.stats.StateInfo[] states;
-}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/State.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/State.aidl
new file mode 100644
index 0000000..2a8e6f8
--- /dev/null
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/State.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power.stats;
+@VintfStability
+parcelable State {
+ int id;
+ @utf8InCpp String name;
+}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateInfo.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateInfo.aidl
deleted file mode 100644
index 0db9ab1..0000000
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateInfo.aidl
+++ /dev/null
@@ -1,23 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.power.stats;
-@VintfStability
-parcelable StateInfo {
- int stateId;
- @utf8InCpp String stateName;
-}
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidency.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidency.aidl
index 206c974..cb38df5 100644
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidency.aidl
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidency.aidl
@@ -2,13 +2,14 @@
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
@@ -18,7 +19,7 @@
package android.hardware.power.stats;
@VintfStability
parcelable StateResidency {
- int stateId;
+ int id;
long totalTimeInStateMs;
long totalStateEntryCount;
long lastEntryTimestampMs;
diff --git a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidencyResult.aidl b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidencyResult.aidl
index dc41fef..9f92253 100644
--- a/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidencyResult.aidl
+++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/StateResidencyResult.aidl
@@ -2,13 +2,14 @@
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
//
-// You must not make a backward incompatible changes to the AIDL files built
+// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
@@ -18,6 +19,6 @@
package android.hardware.power.stats;
@VintfStability
parcelable StateResidencyResult {
- int powerEntityId;
+ int id;
android.hardware.power.stats.StateResidency[] stateResidencyData;
}
diff --git a/power/stats/aidl/android/hardware/power/stats/ChannelInfo.aidl b/power/stats/aidl/android/hardware/power/stats/Channel.aidl
similarity index 77%
rename from power/stats/aidl/android/hardware/power/stats/ChannelInfo.aidl
rename to power/stats/aidl/android/hardware/power/stats/Channel.aidl
index a2ca6a6..09c7d75 100644
--- a/power/stats/aidl/android/hardware/power/stats/ChannelInfo.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/Channel.aidl
@@ -17,14 +17,14 @@
package android.hardware.power.stats;
@VintfStability
-parcelable ChannelInfo {
+parcelable Channel {
/**
- * Unique ID of this ChannelInfo
+ * Unique ID of this Channel
*/
- int channelId;
+ int id;
/**
- * Unique name of the ChannelInfo. Vendor/device specific. Opaque to framework
+ * Unique name of this Channel. Vendor/device specific. Opaque to framework
*/
- @utf8InCpp String channelName;
+ @utf8InCpp String name;
}
diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyConsumer.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyConsumer.aidl
new file mode 100644
index 0000000..065d999
--- /dev/null
+++ b/power/stats/aidl/android/hardware/power/stats/EnergyConsumer.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.power.stats;
+
+import android.hardware.power.stats.EnergyConsumerType;
+
+@VintfStability
+parcelable EnergyConsumer {
+ /**
+ * Unique ID of this EnergyConsumer
+ */
+ int id;
+
+ /**
+ * For a group of EnergyConsumers of the same logical type, sorting by ordinal should
+ * be give their physical order. No other meaning is carried by it.
+ */
+ int ordinal;
+
+ /* Type of this EnergyConsumer */
+ EnergyConsumerType type;
+
+ /**
+ * Unique name of this EnergyConsumer. Vendor/device specific. Opaque to framework
+ */
+ @utf8InCpp String name;
+}
\ No newline at end of file
diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl
index e07204a..5767de1 100644
--- a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl
@@ -19,7 +19,7 @@
@VintfStability
parcelable EnergyConsumerAttribution {
/**
- * Android ID / Linux UID, the accumulated energy should be attributed to
+ * Android ID / Linux UID, the accumulated energy is attributed to
*/
int uid;
/**
diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl
index e8d3dd9..12d2042 100644
--- a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl
@@ -16,7 +16,6 @@
package android.hardware.power.stats;
-import android.hardware.power.stats.EnergyConsumerId;
import android.hardware.power.stats.EnergyConsumerAttribution;
@VintfStability
@@ -24,17 +23,18 @@
/**
* ID of the EnergyConsumer associated with this result
*/
- EnergyConsumerId energyConsumerId;
+ int id;
/**
* Time since boot in milliseconds
*/
long timestampMs;
/**
- * Accumulated energy since boot in microwatt-seconds (uWs)
+ * Total accumulated energy since boot in microwatt-seconds (uWs)
*/
long energyUWs;
/**
- * Optional attribution per UID for this EnergyConsumer.
+ * Optional attributed energy per Android ID / Linux UID for this EnergyConsumer.
+ * Sum total of attributed energy must be less than or equal to total accumulated energy.
*/
EnergyConsumerAttribution[] attribution;
}
diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerId.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerType.aidl
similarity index 82%
rename from power/stats/aidl/android/hardware/power/stats/EnergyConsumerId.aidl
rename to power/stats/aidl/android/hardware/power/stats/EnergyConsumerType.aidl
index 4a6a677..7fd2348 100644
--- a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerId.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerType.aidl
@@ -16,9 +16,10 @@
package android.hardware.power.stats;
+/* Indicates the type of an energy consumer reported by the Power Stats HAL */
@VintfStability
-@Backing(type="int")
-enum EnergyConsumerId {
- DISPLAY = 0,
- GPS = 1,
+enum EnergyConsumerType {
+ OTHER,
+ CPU_CLUSTER,
+ DISPLAY,
}
\ No newline at end of file
diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyMeasurement.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyMeasurement.aidl
index d81914d..d3e8f46 100644
--- a/power/stats/aidl/android/hardware/power/stats/EnergyMeasurement.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/EnergyMeasurement.aidl
@@ -21,7 +21,7 @@
/**
* ID of the Channel associated with this measurement
*/
- int channelId;
+ int id;
/**
* Approximate time of data capture in millseconds since boot
*/
diff --git a/power/stats/aidl/android/hardware/power/stats/IPowerStats.aidl b/power/stats/aidl/android/hardware/power/stats/IPowerStats.aidl
index 05e2004..24a8f67 100644
--- a/power/stats/aidl/android/hardware/power/stats/IPowerStats.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/IPowerStats.aidl
@@ -16,11 +16,11 @@
package android.hardware.power.stats;
-import android.hardware.power.stats.ChannelInfo;
-import android.hardware.power.stats.EnergyConsumerId;
+import android.hardware.power.stats.Channel;
+import android.hardware.power.stats.EnergyConsumer;
import android.hardware.power.stats.EnergyConsumerResult;
import android.hardware.power.stats.EnergyMeasurement;
-import android.hardware.power.stats.PowerEntityInfo;
+import android.hardware.power.stats.PowerEntity;
import android.hardware.power.stats.StateResidencyResult;
@VintfStability
@@ -34,7 +34,7 @@
*
* @return List of information on each PowerEntity
*/
- PowerEntityInfo[] getPowerEntityInfo();
+ PowerEntity[] getPowerEntityInfo();
/**
* Reports the accumulated state residency for each requested PowerEntity.
@@ -61,15 +61,14 @@
StateResidencyResult[] getStateResidency(in int[] powerEntityIds);
/**
- * Return the list IDs for all supported EnergyConsumers for which energy consumption data is
- * available.
+ * Return the list EnergyConsumers for which energy consumption data is available.
*
* An EnergyConsumer is a device subsystem or peripheral that consumes energy. Energy
* consumption data may be used by framework for the purpose of power attribution.
*
- * @return List of EnergyConsumersIds that are available.
+ * @return List of EnergyConsumers that are available.
*/
- EnergyConsumerId[] getEnergyConsumerInfo();
+ EnergyConsumer[] getEnergyConsumerInfo();
/**
* Reports the energy consumed since boot by each requested EnergyConsumer.
@@ -83,7 +82,7 @@
* - STATUS_BAD_VALUE if an invalid energyConsumerId is provided
* - STATUS_FAILED_TRANSACTION if any EnergyConsumerResult fails to be returned
*/
- EnergyConsumerResult[] getEnergyConsumed(in EnergyConsumerId[] energyConsumerIds);
+ EnergyConsumerResult[] getEnergyConsumed(in int[] energyConsumerIds);
/**
* Return information related to all channels monitored by Energy Meters.
@@ -91,9 +90,9 @@
* An Energy Meter is a device that monitors energy and may support monitoring multiple
* channels simultaneously. A channel may correspond a bus, sense resistor, or power rail.
*
- * @return Information about channels monitored by Energy Meters.
+ * @return Channels monitored by Energy Meters.
*/
- ChannelInfo[] getEnergyMeterInfo();
+ Channel[] getEnergyMeterInfo();
/**
* Reports accumulated energy for each specified channel.
diff --git a/power/stats/aidl/android/hardware/power/stats/ChannelInfo.aidl b/power/stats/aidl/android/hardware/power/stats/PowerEntity.aidl
similarity index 68%
copy from power/stats/aidl/android/hardware/power/stats/ChannelInfo.aidl
copy to power/stats/aidl/android/hardware/power/stats/PowerEntity.aidl
index a2ca6a6..6844a4c 100644
--- a/power/stats/aidl/android/hardware/power/stats/ChannelInfo.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/PowerEntity.aidl
@@ -16,15 +16,20 @@
package android.hardware.power.stats;
-@VintfStability
-parcelable ChannelInfo {
- /**
- * Unique ID of this ChannelInfo
- */
- int channelId;
- /**
- * Unique name of the ChannelInfo. Vendor/device specific. Opaque to framework
- */
- @utf8InCpp String channelName;
-}
+import android.hardware.power.stats.State;
+@VintfStability
+parcelable PowerEntity {
+ /**
+ * Unique ID of this PowerEntity
+ */
+ int id;
+ /**
+ * Unique name of this PowerEntity. Vendor/device specific. Opaque to framework
+ */
+ @utf8InCpp String name;
+ /**
+ * List of states that this PowerEntity may reside in
+ */
+ State[] states;
+}
\ No newline at end of file
diff --git a/power/stats/aidl/android/hardware/power/stats/PowerEntityInfo.aidl b/power/stats/aidl/android/hardware/power/stats/PowerEntityInfo.aidl
deleted file mode 100644
index 002b343..0000000
--- a/power/stats/aidl/android/hardware/power/stats/PowerEntityInfo.aidl
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.power.stats;
-
-import android.hardware.power.stats.StateInfo;
-
-@VintfStability
-parcelable PowerEntityInfo {
- /**
- * Unique ID of this PowerEntityInfo
- */
- int powerEntityId;
- /**
- * Unique name of the PowerEntity. Vendor/device specific. Opaque to framework
- */
- @utf8InCpp String powerEntityName;
- /**
- * List of states that the PowerEntity may reside in
- */
- StateInfo[] states;
-}
\ No newline at end of file
diff --git a/power/stats/aidl/android/hardware/power/stats/StateInfo.aidl b/power/stats/aidl/android/hardware/power/stats/State.aidl
similarity index 76%
rename from power/stats/aidl/android/hardware/power/stats/StateInfo.aidl
rename to power/stats/aidl/android/hardware/power/stats/State.aidl
index 5703f1e..33a9f70 100644
--- a/power/stats/aidl/android/hardware/power/stats/StateInfo.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/State.aidl
@@ -17,15 +17,15 @@
package android.hardware.power.stats;
@VintfStability
-parcelable StateInfo {
+parcelable State {
/**
- * Unique (for a given PowerEntityInfo) ID of this StateInfo
+ * Unique (for a given PowerEntity) ID of this State
*/
- int stateId;
+ int id;
/**
- * Unique (for a given PowerEntityInfo) name of the state. Vendor/device specific.
+ * Unique (for a given PowerEntity) name of the state. Vendor/device specific.
* Opaque to framework
*/
- @utf8InCpp String stateName;
+ @utf8InCpp String name;
}
diff --git a/power/stats/aidl/android/hardware/power/stats/StateResidency.aidl b/power/stats/aidl/android/hardware/power/stats/StateResidency.aidl
index a85ca33..4162517 100644
--- a/power/stats/aidl/android/hardware/power/stats/StateResidency.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/StateResidency.aidl
@@ -24,7 +24,7 @@
/**
* ID of the state associated with this residency
*/
- int stateId;
+ int id;
/**
* Total time in milliseconds that the corresponding PowerEntity resided
* in this state since boot
diff --git a/power/stats/aidl/android/hardware/power/stats/StateResidencyResult.aidl b/power/stats/aidl/android/hardware/power/stats/StateResidencyResult.aidl
index 3356405..949879c 100644
--- a/power/stats/aidl/android/hardware/power/stats/StateResidencyResult.aidl
+++ b/power/stats/aidl/android/hardware/power/stats/StateResidencyResult.aidl
@@ -23,7 +23,7 @@
/**
* ID of the PowerEntity associated with this result
*/
- int powerEntityId;
+ int id;
/**
* Residency for each state in the PowerEntity's state space
*/
diff --git a/power/stats/aidl/default/PowerStats.cpp b/power/stats/aidl/default/PowerStats.cpp
index 367ee95..6cb0a73 100644
--- a/power/stats/aidl/default/PowerStats.cpp
+++ b/power/stats/aidl/default/PowerStats.cpp
@@ -24,7 +24,7 @@
namespace power {
namespace stats {
-ndk::ScopedAStatus PowerStats::getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) {
+ndk::ScopedAStatus PowerStats::getPowerEntityInfo(std::vector<PowerEntity>* _aidl_return) {
(void)_aidl_return;
return ndk::ScopedAStatus::ok();
}
@@ -36,20 +36,19 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus PowerStats::getEnergyConsumerInfo(std::vector<EnergyConsumerId>* _aidl_return) {
+ndk::ScopedAStatus PowerStats::getEnergyConsumerInfo(std::vector<EnergyConsumer>* _aidl_return) {
(void)_aidl_return;
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus PowerStats::getEnergyConsumed(
- const std::vector<EnergyConsumerId>& in_energyConsumerIds,
- std::vector<EnergyConsumerResult>* _aidl_return) {
+ndk::ScopedAStatus PowerStats::getEnergyConsumed(const std::vector<int32_t>& 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) {
+ndk::ScopedAStatus PowerStats::getEnergyMeterInfo(std::vector<Channel>* _aidl_return) {
(void)_aidl_return;
return ndk::ScopedAStatus::ok();
}
diff --git a/power/stats/aidl/default/PowerStats.h b/power/stats/aidl/default/PowerStats.h
index 76ab2cb..04c2d54 100644
--- a/power/stats/aidl/default/PowerStats.h
+++ b/power/stats/aidl/default/PowerStats.h
@@ -28,13 +28,13 @@
public:
PowerStats() = default;
// Methods from aidl::android::hardware::power::stats::IPowerStats
- ndk::ScopedAStatus getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) override;
+ ndk::ScopedAStatus getPowerEntityInfo(std::vector<PowerEntity>* _aidl_return) override;
ndk::ScopedAStatus getStateResidency(const std::vector<int32_t>& in_powerEntityIds,
std::vector<StateResidencyResult>* _aidl_return) override;
- ndk::ScopedAStatus getEnergyConsumerInfo(std::vector<EnergyConsumerId>* _aidl_return) override;
- ndk::ScopedAStatus getEnergyConsumed(const std::vector<EnergyConsumerId>& in_energyConsumerIds,
+ ndk::ScopedAStatus getEnergyConsumerInfo(std::vector<EnergyConsumer>* _aidl_return) override;
+ ndk::ScopedAStatus getEnergyConsumed(const std::vector<int32_t>& in_energyConsumerIds,
std::vector<EnergyConsumerResult>* _aidl_return) override;
- ndk::ScopedAStatus getEnergyMeterInfo(std::vector<ChannelInfo>* _aidl_return) override;
+ ndk::ScopedAStatus getEnergyMeterInfo(std::vector<Channel>* _aidl_return) override;
ndk::ScopedAStatus readEnergyMeters(const std::vector<int32_t>& in_channelIds,
std::vector<EnergyMeasurement>* _aidl_return) override;
};
diff --git a/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp b/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp
index 1d30821..f293773 100644
--- a/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp
+++ b/power/stats/aidl/vts/VtsHalPowerStatsTargetTest.cpp
@@ -21,10 +21,10 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
-using aidl::android::hardware::power::stats::ChannelInfo;
+using aidl::android::hardware::power::stats::Channel;
using aidl::android::hardware::power::stats::EnergyMeasurement;
using aidl::android::hardware::power::stats::IPowerStats;
-using aidl::android::hardware::power::stats::PowerEntityInfo;
+using aidl::android::hardware::power::stats::PowerEntity;
using aidl::android::hardware::power::stats::StateResidencyResult;
using ndk::SpAIBinder;
@@ -47,70 +47,70 @@
// Each PowerEntity must have a valid name
TEST_P(PowerStatsAidl, ValidatePowerEntityNames) {
- std::vector<PowerEntityInfo> infos;
+ std::vector<PowerEntity> infos;
ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
for (auto info : infos) {
- EXPECT_NE(info.powerEntityName, "");
+ EXPECT_NE(info.name, "");
}
}
// Each power entity must have a unique name
TEST_P(PowerStatsAidl, ValidatePowerEntityUniqueNames) {
- std::vector<PowerEntityInfo> infos;
+ std::vector<PowerEntity> infos;
ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
std::set<std::string> names;
for (auto info : infos) {
- EXPECT_TRUE(names.insert(info.powerEntityName).second);
+ EXPECT_TRUE(names.insert(info.name).second);
}
}
// Each PowerEntity must have a unique ID
TEST_P(PowerStatsAidl, ValidatePowerEntityIds) {
- std::vector<PowerEntityInfo> infos;
+ std::vector<PowerEntity> infos;
ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
std::set<int32_t> ids;
for (auto info : infos) {
- EXPECT_TRUE(ids.insert(info.powerEntityId).second);
+ EXPECT_TRUE(ids.insert(info.id).second);
}
}
// Each state must have a valid name
TEST_P(PowerStatsAidl, ValidateStateNames) {
- std::vector<PowerEntityInfo> infos;
+ std::vector<PowerEntity> infos;
ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
for (auto info : infos) {
for (auto state : info.states) {
- EXPECT_NE(state.stateName, "");
+ EXPECT_NE(state.name, "");
}
}
}
// Each state must have a name that is unique to the given PowerEntity
TEST_P(PowerStatsAidl, ValidateStateUniqueNames) {
- std::vector<PowerEntityInfo> infos;
+ std::vector<PowerEntity> infos;
ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
for (auto info : infos) {
std::set<std::string> stateNames;
for (auto state : info.states) {
- EXPECT_TRUE(stateNames.insert(state.stateName).second);
+ EXPECT_TRUE(stateNames.insert(state.name).second);
}
}
}
// Each state must have an ID that is unique to the given PowerEntity
TEST_P(PowerStatsAidl, ValidateStateUniqueIds) {
- std::vector<PowerEntityInfo> infos;
+ std::vector<PowerEntity> infos;
ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
for (auto info : infos) {
std::set<int32_t> stateIds;
for (auto state : info.states) {
- EXPECT_TRUE(stateIds.insert(state.stateId).second);
+ EXPECT_TRUE(stateIds.insert(state.id).second);
}
}
}
@@ -121,7 +121,7 @@
}
TEST_P(PowerStatsAidl, TestGetEnergyMeterInfo) {
- std::vector<ChannelInfo> info;
+ std::vector<Channel> info;
ASSERT_TRUE(powerstats->getEnergyMeterInfo(&info).isOk());
}