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_CONSUMERPower monitor corresponding to a subsystem. | 
| int | POWER_MONITOR_TYPE_MEASUREMENTPower 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
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
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
Public methods
describeContents
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 0orCONTENTS_FILE_DESCRIPTOR | 
getName
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
public int getType ()
Returns the type of the power monitor.
| Returns | |
|---|---|
| int | Value is either 0or a combination ofPOWER_MONITOR_TYPE_CONSUMER, andPOWER_MONITOR_TYPE_MEASUREMENT | 
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
| dest | Parcel: This value cannot benull. | 
| flags | int: Additional flags about how the object should be written.
 May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE.
 Value is either0or a combination ofParcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
