Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42408279 authored by Benjamin Schwartz's avatar Benjamin Schwartz
Browse files

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
parent a91c261c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

package android.hardware.powerstats;
@VintfStability
parcelable PowerEntityStateInfo {
  int powerEntityStateId;
  String powerEntityStateName;
parcelable ChannelInfo {
  int channelId;
  String channelName;
}
+23 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// 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.powerstats;
@Backing(type="int") @VintfStability
enum EnergyConsumerId {
  DISPLAY = 0,
  GPS = 1,
}
+24 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// 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.powerstats;
@VintfStability
parcelable EnergyConsumerResult {
  android.hardware.powerstats.EnergyConsumerId energyConsumerId;
  long timestampMs;
  long energyUWs;
}
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@

package android.hardware.powerstats;
@VintfStability
parcelable EnergyData {
  int railIndex;
parcelable EnergyMeasurement {
  int channelId;
  long timestampMs;
  long energyUWs;
}
+5 −3
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@
package android.hardware.powerstats;
@VintfStability
interface IPowerStats {
  android.hardware.powerstats.EnergyData[] getEnergyData(in int[] railIndices);
  android.hardware.powerstats.PowerEntityInfo[] getPowerEntityInfo();
  android.hardware.powerstats.PowerEntityStateResidencyResult[] getPowerEntityStateResidencyData(in int[] powerEntityIds);
  android.hardware.powerstats.RailInfo[] getRailInfo();
  android.hardware.powerstats.StateResidencyResult[] getPowerEntityStateResidency(in int[] powerEntityIds);
  android.hardware.powerstats.EnergyConsumerId[] getEnergyConsumerInfo();
  android.hardware.powerstats.EnergyConsumerResult[] getEnergyConsumed(in android.hardware.powerstats.EnergyConsumerId[] energyConsumerIds);
  android.hardware.powerstats.ChannelInfo[] getEnergyMeterInfo();
  android.hardware.powerstats.EnergyMeasurement[] readEnergyMeters(in int[] channelIds);
}
Loading