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 new file mode 100644 index 0000000000..0a7cff7d01 --- /dev/null +++ b/power/stats/aidl/aidl_api/android.hardware.power.stats/current/android/hardware/power/stats/EnergyConsumerAttribution.aidl @@ -0,0 +1,23 @@ +/////////////////////////////////////////////////////////////////////////////// +// 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 EnergyConsumerAttribution { + int uid; + long energyUWs; +} 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 6289a08439..815316ec92 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 @@ -21,4 +21,5 @@ parcelable EnergyConsumerResult { android.hardware.power.stats.EnergyConsumerId energyConsumerId; long timestampMs; long energyUWs; + android.hardware.power.stats.EnergyConsumerAttribution[] attribution; } diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl new file mode 100644 index 0000000000..e07204aa33 --- /dev/null +++ b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerAttribution.aidl @@ -0,0 +1,29 @@ +/* + * 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; + +@VintfStability +parcelable EnergyConsumerAttribution { + /** + * Android ID / Linux UID, the accumulated energy should be attributed to + */ + int uid; + /** + * Accumulated energy since boot in microwatt-seconds (uWs) for this AID + */ + long energyUWs; +} diff --git a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl index d2b902ae56..e8d3dd9f94 100644 --- a/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl +++ b/power/stats/aidl/android/hardware/power/stats/EnergyConsumerResult.aidl @@ -17,6 +17,7 @@ package android.hardware.power.stats; import android.hardware.power.stats.EnergyConsumerId; +import android.hardware.power.stats.EnergyConsumerAttribution; @VintfStability parcelable EnergyConsumerResult { @@ -32,5 +33,9 @@ parcelable EnergyConsumerResult { * Accumulated energy since boot in microwatt-seconds (uWs) */ long energyUWs; + /** + * Optional attribution per UID for this EnergyConsumer. + */ + EnergyConsumerAttribution[] attribution; }