public class PowerProfile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PowerProfile.CpuClusterKey |
Modifier and Type | Field and Description |
---|---|
static String |
POWER_AUDIO
Power consumed by the audio hardware when playing back audio content.
|
static String |
POWER_BATTERY_CAPACITY
Battery capacity in milliAmpHour (mAh).
|
static String |
POWER_BLUETOOTH_ACTIVE
Deprecated.
|
static String |
POWER_BLUETOOTH_AT_CMD
Deprecated.
|
static String |
POWER_BLUETOOTH_CONTROLLER_IDLE |
static String |
POWER_BLUETOOTH_CONTROLLER_OPERATING_VOLTAGE |
static String |
POWER_BLUETOOTH_CONTROLLER_RX |
static String |
POWER_BLUETOOTH_CONTROLLER_TX |
static String |
POWER_BLUETOOTH_ON
Deprecated.
|
static String |
POWER_CAMERA
Average power consumption when the camera is on over all standard use cases.
|
static String |
POWER_CPU_ACTIVE
Deprecated.
|
static String |
POWER_CPU_AWAKE
Power consumption when CPU is awake (when a wake lock is held).
|
static String |
POWER_CPU_IDLE
Power consumption when CPU is in power collapse mode.
|
static String |
POWER_CPU_SPEEDS
Deprecated.
|
static String |
POWER_FLASHLIGHT
Average power consumption when camera flashlight is on.
|
static String |
POWER_GPS_ON
Power consumption when GPS is on.
|
static String |
POWER_MODEM_CONTROLLER_IDLE |
static String |
POWER_MODEM_CONTROLLER_OPERATING_VOLTAGE |
static String |
POWER_MODEM_CONTROLLER_RX |
static String |
POWER_MODEM_CONTROLLER_TX |
static String |
POWER_NONE
No power consumption, or accounted for elsewhere.
|
static String |
POWER_RADIO_ACTIVE
Power consumption when talking on the phone.
|
static String |
POWER_RADIO_ON
Power consumption when cell radio is on but not on a call.
|
static String |
POWER_RADIO_SCANNING
Power consumption when cell radio is hunting for a signal.
|
static String |
POWER_SCREEN_FULL
Power consumption at full backlight brightness.
|
static String |
POWER_SCREEN_ON
Power consumption when screen is on, not including the backlight power.
|
static String |
POWER_VIDEO
Power consumed by any media hardware when playing back video content.
|
static String |
POWER_WIFI_ACTIVE
Power consumption when WiFi driver is transmitting/receiving.
|
static String |
POWER_WIFI_BATCHED_SCAN
Power consumed by wif batched scaning.
|
static String |
POWER_WIFI_CONTROLLER_IDLE |
static String |
POWER_WIFI_CONTROLLER_OPERATING_VOLTAGE |
static String |
POWER_WIFI_CONTROLLER_RX |
static String |
POWER_WIFI_CONTROLLER_TX |
static String |
POWER_WIFI_CONTROLLER_TX_LEVELS |
static String |
POWER_WIFI_ON
Power consumption when WiFi driver is on.
|
static String |
POWER_WIFI_SCAN
Power consumption when WiFi driver is scanning for networks.
|
Constructor and Description |
---|
PowerProfile(Context context) |
Modifier and Type | Method and Description |
---|---|
double |
getAveragePower(String type)
Returns the average current in mA consumed by the subsystem
|
double |
getAveragePower(String type,
int level)
Returns the average current in mA consumed by the subsystem for the given level.
|
double |
getAveragePowerForCpu(int cluster,
int step) |
double |
getAveragePowerOrDefault(String type,
double defaultValue)
Returns the average current in mA consumed by the subsystem, or the given
default value if the subsystem has no recorded value.
|
double |
getBatteryCapacity()
Returns the battery capacity, if available, in milli Amp Hours.
|
int |
getNumCoresInCpuCluster(int index) |
int |
getNumCpuClusters() |
int |
getNumSpeedStepsInCpuCluster(int index) |
public static final String POWER_NONE
public static final String POWER_CPU_IDLE
public static final String POWER_CPU_AWAKE
@Deprecated public static final String POWER_CPU_ACTIVE
public static final String POWER_WIFI_SCAN
public static final String POWER_WIFI_ON
public static final String POWER_WIFI_ACTIVE
public static final String POWER_WIFI_CONTROLLER_IDLE
public static final String POWER_WIFI_CONTROLLER_RX
public static final String POWER_WIFI_CONTROLLER_TX
public static final String POWER_WIFI_CONTROLLER_TX_LEVELS
public static final String POWER_WIFI_CONTROLLER_OPERATING_VOLTAGE
public static final String POWER_BLUETOOTH_CONTROLLER_IDLE
public static final String POWER_BLUETOOTH_CONTROLLER_RX
public static final String POWER_BLUETOOTH_CONTROLLER_TX
public static final String POWER_BLUETOOTH_CONTROLLER_OPERATING_VOLTAGE
public static final String POWER_MODEM_CONTROLLER_IDLE
public static final String POWER_MODEM_CONTROLLER_RX
public static final String POWER_MODEM_CONTROLLER_TX
public static final String POWER_MODEM_CONTROLLER_OPERATING_VOLTAGE
public static final String POWER_GPS_ON
@Deprecated public static final String POWER_BLUETOOTH_ON
@Deprecated public static final String POWER_BLUETOOTH_ACTIVE
@Deprecated public static final String POWER_BLUETOOTH_AT_CMD
public static final String POWER_SCREEN_ON
public static final String POWER_RADIO_ON
public static final String POWER_RADIO_SCANNING
public static final String POWER_RADIO_ACTIVE
public static final String POWER_SCREEN_FULL
public static final String POWER_AUDIO
public static final String POWER_VIDEO
public static final String POWER_FLASHLIGHT
public static final String POWER_CAMERA
@Deprecated public static final String POWER_CPU_SPEEDS
public static final String POWER_WIFI_BATCHED_SCAN
public static final String POWER_BATTERY_CAPACITY
public PowerProfile(Context context)
public int getNumCpuClusters()
public int getNumCoresInCpuCluster(int index)
public int getNumSpeedStepsInCpuCluster(int index)
public double getAveragePowerForCpu(int cluster, int step)
public double getAveragePowerOrDefault(String type, double defaultValue)
type
- the subsystem typedefaultValue
- the value to return if the subsystem has no recorded value.public double getAveragePower(String type)
type
- the subsystem typepublic double getAveragePower(String type, int level)
type
- the subsystem typelevel
- the level of power at which the subsystem is running. For instance, the
signal strength of the cell network between 0 and 4 (if there are 4 bars max.)
If there is no data for multiple levels, the level is ignored.public double getBatteryCapacity()