Added in API level 35

PowerMonitor


class PowerMonitor : Parcelable
kotlin.Any
   ↳ 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
static Int

Power monitor corresponding to a subsystem.

static Int

Power monitor corresponding to a directly measured power rail.

Inherited constants
Public methods
Int

String

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

Int

Returns the type of the power monitor.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<PowerMonitor!>

Constants

POWER_MONITOR_TYPE_CONSUMER

Added in API level 35
static val POWER_MONITOR_TYPE_CONSUMER: Int

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.

Value: 0

POWER_MONITOR_TYPE_MEASUREMENT

Added in API level 35
static val POWER_MONITOR_TYPE_MEASUREMENT: Int

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.

Value: 1

Public methods

describeContents

Added in API level 35
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getName

Added in API level 35
fun getName(): String

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

Return
String This value cannot be null.

getType

Added in API level 35
fun getType(): Int

Returns the type of the power monitor.

Return
Int Value is either 0 or a combination of android.os.PowerMonitor#POWER_MONITOR_TYPE_CONSUMER, and android.os.PowerMonitor#POWER_MONITOR_TYPE_MEASUREMENT

writeToParcel

Added in API level 35
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

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_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 35
static val CREATOR: Parcelable.Creator<PowerMonitor!>