PowerMonitor


public final class PowerMonitor
extends Object implements Parcelable

java.lang.Object
   ↳ android.os.PowerMonitor


A PowerMonitor represents either an ODPM rail (on-device power rail monitor) or a modeled energy consumer.

ODPM rail names are device-specific. No assumptions should be made about the names and exact purpose of ODPM rails across different device models. A rail name may be something like "S2S_VDD_G3D"; specific knowledge of the device hardware is required to interpret the corresponding power monitor data.

Energy consumer have more human-readable names, e.g. "GPU", "MODEM" etc. However, developers must be extra cautious about using energy consumers across different device models, as their exact implementations are also hardware dependent and are customized by OEMs.

Summary

Constants

int POWER_MONITOR_TYPE_CONSUMER

Power monitor corresponding to a subsystem.

int POWER_MONITOR_TYPE_MEASUREMENT

Power monitor corresponding to a directly measured power rail.

Inherited constants

Fields

public static final Creator<PowerMonitor> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

String getName()

Returns the name of the power monitor, either a power rail or an energy consumer.

int getType()

Returns the type of the power monitor.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

POWER_MONITOR_TYPE_CONSUMER

Added in API level 35
public static final int POWER_MONITOR_TYPE_CONSUMER

Power monitor corresponding to a subsystem. The energy value may be a direct pass-through power rail measurement, or modeled in some fashion. For example, an energy consumer may represent a combination of multiple rails or a portion of a rail shared between subsystems, e.g. WiFi and Bluetooth are often handled by the same chip, powered by a shared rail. Some consumer names are standardized, others are not.

Constant Value: 0 (0x00000000)

POWER_MONITOR_TYPE_MEASUREMENT

Added in API level 35
public static final int POWER_MONITOR_TYPE_MEASUREMENT

Power monitor corresponding to a directly measured power rail. Rails are device-specific: no assumptions can be made about the source of those measurements across different devices, even if they have the same name.

Constant Value: 1 (0x00000001)

Fields

CREATOR

Added in API level 35
public static final Creator<PowerMonitor> CREATOR

Public methods

describeContents

Added in API level 35
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getName

Added in API level 35
public String getName ()

Returns the name of the power monitor, either a power rail or an energy consumer.

Returns
String This value cannot be null.

getType

Added in API level 35
public int getType ()

Returns the type of the power monitor.

Returns
int Value is either 0 or a combination of POWER_MONITOR_TYPE_CONSUMER, and POWER_MONITOR_TYPE_MEASUREMENT

writeToParcel

Added in API level 35
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES