Merge "power/stats: Add EnergyConsumerAttribution interface"

This commit is contained in:
Benjamin Schwartz
2021-01-05 17:52:41 +00:00
committed by Android (Google) Code Review
4 changed files with 58 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -21,4 +21,5 @@ parcelable EnergyConsumerResult {
android.hardware.power.stats.EnergyConsumerId energyConsumerId;
long timestampMs;
long energyUWs;
android.hardware.power.stats.EnergyConsumerAttribution[] attribution;
}

View File

@@ -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;
}

View File

@@ -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;
}