public class BatteryStatsImpl extends BatteryStats
Modifier and Type | Class and Description |
---|---|
static class |
BatteryStatsImpl.BatchTimer
A timer that increments in batches.
|
static interface |
BatteryStatsImpl.BatteryCallback |
static interface |
BatteryStatsImpl.Clocks |
static class |
BatteryStatsImpl.ControllerActivityCounterImpl |
static class |
BatteryStatsImpl.Counter
State for keeping track of counting information.
|
static class |
BatteryStatsImpl.DurationTimer
A StopwatchTimer that also tracks the total and max individual
time spent active according to the given timebase.
|
static interface |
BatteryStatsImpl.ExternalStatsSync |
static class |
BatteryStatsImpl.LongSamplingCounter |
class |
BatteryStatsImpl.OverflowArrayMap<T> |
static interface |
BatteryStatsImpl.PlatformIdleStateCallback |
static class |
BatteryStatsImpl.SamplingTimer
A counter meant to accept monotonically increasing values to its
BatteryStatsImpl.SamplingTimer.update(long, int)
method. |
static class |
BatteryStatsImpl.StopwatchTimer
State for keeping track of timing information.
|
static class |
BatteryStatsImpl.SystemClocks |
static class |
BatteryStatsImpl.TimeBase |
static interface |
BatteryStatsImpl.TimeBaseObs |
static class |
BatteryStatsImpl.Timer
State for keeping track of timing information.
|
static class |
BatteryStatsImpl.Uid
The statistics associated with a particular uid.
|
BatteryStats.BitDescription, BatteryStats.ControllerActivityCounter, BatteryStats.DailyItem, BatteryStats.HistoryEventTracker, BatteryStats.HistoryItem, BatteryStats.HistoryPrinter, BatteryStats.HistoryStepDetails, BatteryStats.HistoryTag, BatteryStats.LevelStepTracker, BatteryStats.LongCounter, BatteryStats.PackageChange
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static int |
BATTERY_PLUGGED_NONE |
static Parcelable.Creator<BatteryStatsImpl> |
CREATOR |
static boolean |
DEBUG_ENERGY |
AtomicFile |
mCheckinFile |
protected BatteryStatsImpl.Clocks |
mClocks |
AtomicFile |
mDailyFile |
com.android.internal.os.BatteryStatsImpl.MyHandler |
mHandler |
protected BatteryStatsImpl.TimeBase |
mOnBatteryTimeBase |
boolean |
mRecordAllHistory |
AUDIO_TURNED_ON, BLUETOOTH_SCAN_ON, CAMERA_TURNED_ON, DATA_CONNECTION_1xRTT, DATA_CONNECTION_CDMA, DATA_CONNECTION_EDGE, DATA_CONNECTION_EHRPD, DATA_CONNECTION_EVDO_0, DATA_CONNECTION_EVDO_A, DATA_CONNECTION_EVDO_B, DATA_CONNECTION_GPRS, DATA_CONNECTION_HSDPA, DATA_CONNECTION_HSPA, DATA_CONNECTION_HSPAP, DATA_CONNECTION_HSUPA, DATA_CONNECTION_IDEN, DATA_CONNECTION_LTE, DATA_CONNECTION_NONE, DATA_CONNECTION_OTHER, DATA_CONNECTION_UMTS, DEVICE_IDLE_MODE_DEEP, DEVICE_IDLE_MODE_LIGHT, DEVICE_IDLE_MODE_OFF, DUMP_CHARGED_ONLY, DUMP_DAILY_ONLY, DUMP_DEVICE_WIFI_ONLY, DUMP_HISTORY_ONLY, DUMP_INCLUDE_HISTORY, DUMP_VERBOSE, FLASHLIGHT_TURNED_ON, FOREGROUND_ACTIVITY, FULL_WIFI_LOCK, HISTORY_EVENT_CHECKIN_NAMES, HISTORY_EVENT_NAMES, HISTORY_STATE_DESCRIPTIONS, HISTORY_STATE2_DESCRIPTIONS, JOB, NETWORK_BT_RX_DATA, NETWORK_BT_TX_DATA, NETWORK_MOBILE_RX_DATA, NETWORK_MOBILE_TX_DATA, NETWORK_WIFI_RX_DATA, NETWORK_WIFI_TX_DATA, NUM_DATA_CONNECTION_TYPES, NUM_NETWORK_ACTIVITY_TYPES, NUM_SCREEN_BRIGHTNESS_BINS, NUM_WIFI_SIGNAL_STRENGTH_BINS, NUM_WIFI_STATES, NUM_WIFI_SUPPL_STATES, PROCESS_STATE, RESULT_RECEIVER_CONTROLLER_KEY, SCREEN_BRIGHTNESS_BRIGHT, SCREEN_BRIGHTNESS_DARK, SCREEN_BRIGHTNESS_DIM, SCREEN_BRIGHTNESS_LIGHT, SCREEN_BRIGHTNESS_MEDIUM, SENSOR, SERVICE_NAME, STATS_CURRENT, STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, STEP_LEVEL_INITIAL_MODE_MASK, STEP_LEVEL_INITIAL_MODE_SHIFT, STEP_LEVEL_LEVEL_MASK, STEP_LEVEL_LEVEL_SHIFT, STEP_LEVEL_MODE_DEVICE_IDLE, STEP_LEVEL_MODE_LABELS, STEP_LEVEL_MODE_POWER_SAVE, STEP_LEVEL_MODE_SCREEN_STATE, STEP_LEVEL_MODE_VALUES, STEP_LEVEL_MODES_OF_INTEREST, STEP_LEVEL_MODIFIED_MODE_MASK, STEP_LEVEL_MODIFIED_MODE_SHIFT, STEP_LEVEL_TIME_MASK, SYNC, VIBRATOR_ON, VIDEO_TURNED_ON, WAKE_TYPE_DRAW, WAKE_TYPE_FULL, WAKE_TYPE_PARTIAL, WAKE_TYPE_WINDOW, WIFI_BATCHED_SCAN, WIFI_MULTICAST_ENABLED, WIFI_RUNNING, WIFI_SCAN, WIFI_STATE_OFF, WIFI_STATE_OFF_SCANNING, WIFI_STATE_ON_CONNECTED_P2P, WIFI_STATE_ON_CONNECTED_STA, WIFI_STATE_ON_CONNECTED_STA_P2P, WIFI_STATE_ON_DISCONNECTED, WIFI_STATE_ON_NO_NETWORKS, WIFI_STATE_SOFT_AP, WIFI_SUPPL_STATE_ASSOCIATED, WIFI_SUPPL_STATE_ASSOCIATING, WIFI_SUPPL_STATE_AUTHENTICATING, WIFI_SUPPL_STATE_COMPLETED, WIFI_SUPPL_STATE_DISCONNECTED, WIFI_SUPPL_STATE_DORMANT, WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE, WIFI_SUPPL_STATE_GROUP_HANDSHAKE, WIFI_SUPPL_STATE_INACTIVE, WIFI_SUPPL_STATE_INTERFACE_DISABLED, WIFI_SUPPL_STATE_INVALID, WIFI_SUPPL_STATE_SCANNING, WIFI_SUPPL_STATE_UNINITIALIZED
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
BatteryStatsImpl() |
BatteryStatsImpl(BatteryStatsImpl.Clocks clocks) |
BatteryStatsImpl(BatteryStatsImpl.Clocks clocks,
File systemDir,
Handler handler,
BatteryStatsImpl.ExternalStatsSync externalSync,
BatteryStatsImpl.PlatformIdleStateCallback cb) |
BatteryStatsImpl(BatteryStatsImpl.Clocks clocks,
Parcel p) |
BatteryStatsImpl(File systemDir,
Handler handler,
BatteryStatsImpl.ExternalStatsSync externalSync) |
BatteryStatsImpl(File systemDir,
Handler handler,
BatteryStatsImpl.ExternalStatsSync externalSync,
BatteryStatsImpl.PlatformIdleStateCallback cb) |
BatteryStatsImpl(Parcel p) |
Modifier and Type | Method and Description |
---|---|
void |
addHistoryEventLocked(long elapsedRealtimeMs,
long uptimeMs,
int code,
String name,
int uid) |
void |
addIsolatedUidLocked(int isolatedUid,
int appUid) |
void |
commitCurrentHistoryBatchLocked()
Don't allow any more batching in to the current history event.
|
void |
commitPendingDataToDisk() |
long |
computeBatteryRealtime(long curTime,
int which)
Returns the total, last, or current battery realtime in microseconds.
|
long |
computeBatteryScreenOffRealtime(long curTime,
int which)
Returns the total, last, or current battery screen off realtime in microseconds.
|
long |
computeBatteryScreenOffUptime(long curTime,
int which)
Returns the total, last, or current battery screen off uptime in microseconds.
|
long |
computeBatteryTimeRemaining(long curTime)
Compute an approximation for how much run time (in microseconds) is remaining on
the battery.
|
long |
computeBatteryUptime(long curTime,
int which)
Returns the total, last, or current battery uptime in microseconds.
|
long |
computeChargeTimeRemaining(long curTime)
Compute an approximation for how much time (in microseconds) remains until the battery
is fully charged.
|
long |
computeRealtime(long curTime,
int which)
Returns the total, last, or current realtime in microseconds.
|
long |
computeUptime(long curTime,
int which)
Returns the total, last, or current uptime in microseconds.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
void |
dumpLocked(Context context,
PrintWriter pw,
int flags,
int reqUid,
long histStart)
Dumps a human-readable summary of the battery statistics to the given PrintWriter.
|
void |
finishAddingCpuLocked(int totalUTime,
int totalSTime,
int statUserTime,
int statSystemTime,
int statIOWaitTime,
int statIrqTime,
int statSoftIrqTime,
int statIdleTime) |
void |
finishIteratingHistoryLocked() |
void |
finishIteratingOldHistoryLocked() |
long |
getAwakeTimeBattery() |
long |
getAwakeTimePlugged() |
long |
getBatteryRealtime(long curTime)
Returns the current battery realtime in microseconds.
|
long |
getBatteryUptime(long curTime)
Returns the current battery uptime in microseconds.
|
protected long |
getBatteryUptimeLocked() |
BatteryStats.ControllerActivityCounter |
getBluetoothControllerActivity()
Returns a
BatteryStats.ControllerActivityCounter which is an aggregate of the times spent
in various radio controller states, such as transmit, receive, and idle. |
long |
getBluetoothScanTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that bluetooth scans were running while the device was
on battery.
|
long |
getCameraOnTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the camera has been on while the device was
running on battery.
|
BatteryStats.LevelStepTracker |
getChargeLevelStepTracker()
Return the array of charge step durations.
|
long |
getCurrentDailyStartTime() |
BatteryStats.LevelStepTracker |
getDailyChargeLevelStepTracker()
Return the array of daily charge step durations.
|
BatteryStats.LevelStepTracker |
getDailyDischargeLevelStepTracker()
Return the array of daily discharge step durations.
|
BatteryStats.DailyItem |
getDailyItemLocked(int daysAgo) |
ArrayList<BatteryStats.PackageChange> |
getDailyPackageChanges() |
int |
getDeviceIdleModeCount(int mode,
int which)
Returns the number of times that the devie has gone in to idle mode.
|
long |
getDeviceIdleModeTime(int mode,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that device has been in idle mode while
running on battery.
|
int |
getDeviceIdlingCount(int mode,
int which)
Returns the number of times that the devie has started idling.
|
long |
getDeviceIdlingTime(int mode,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that device has been in idling while on
battery.
|
int |
getDischargeAmount(int which)
Retrieve the discharge amount over the selected discharge period which.
|
int |
getDischargeAmountScreenOff()
Get the amount the battery has discharged while the screen was off,
since the last time power was unplugged.
|
int |
getDischargeAmountScreenOffSinceCharge()
Get the amount the battery has discharged while the screen was off,
since the last time the device was charged.
|
int |
getDischargeAmountScreenOn()
Get the amount the battery has discharged while the screen was on,
since the last time power was unplugged.
|
int |
getDischargeAmountScreenOnSinceCharge()
Get the amount the battery has discharged while the screen was on,
since the last time the device was charged.
|
BatteryStats.LongCounter |
getDischargeCoulombCounter()
Return the counter keeping track of the amount of battery discharge measured in
micro-Ampere-hours.
|
int |
getDischargeCurrentLevel()
Returns the current battery percentage level if we are in a discharge cycle, otherwise
returns the level at the last plug event.
|
int |
getDischargeCurrentLevelLocked() |
BatteryStats.LevelStepTracker |
getDischargeLevelStepTracker()
Return the array of discharge step durations.
|
BatteryStats.LongCounter |
getDischargeScreenOffCoulombCounter()
Return the counter keeping track of the amount of battery discharge while the screen was off,
measured in micro-Ampere-hours.
|
int |
getDischargeStartLevel()
Returns the battery percentage level at the last time the device was unplugged from power, or
the last time it booted on battery power.
|
int |
getDischargeStartLevelLocked() |
String |
getEndPlatformVersion()
Return platform version tag that we were running in when the battery stats ended.
|
int |
getEstimatedBatteryCapacity()
Returns the estimated real battery capacity, which may be less than the capacity
declared by the PowerProfile.
|
long |
getFlashlightOnCount(int which)
Returns the number of times that the flashlight has been turned on while the device was
running on battery.
|
long |
getFlashlightOnTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the flashlight has been on while the device was
running on battery.
|
long |
getGlobalWifiRunningTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that wifi has been on and the driver has
been in the running state while the device was running on battery.
|
int |
getHighDischargeAmountSinceCharge()
Get the amount the battery has discharged since the stats were
last reset after charging, as an upper-end approximation.
|
long |
getHistoryBaseTime()
Return the base time offset for the battery history.
|
int |
getHistoryStringPoolBytes() |
int |
getHistoryStringPoolSize() |
String |
getHistoryTagPoolString(int index) |
int |
getHistoryTagPoolUid(int index) |
int |
getHistoryTotalSize() |
int |
getHistoryUsedSize() |
long |
getInteractiveTime(long elapsedRealtimeUs,
int which) |
boolean |
getIsOnBattery()
Return whether we are currently running on battery.
|
Map<String,? extends BatteryStatsImpl.Timer> |
getKernelWakelockStats() |
BatteryStatsImpl.SamplingTimer |
getKernelWakelockTimerLocked(String name) |
long |
getLongestDeviceIdleModeTime(int mode)
Return the longest duration we spent in a particular device idle mode (fully in the
mode, not in idle maintenance etc).
|
int |
getLowDischargeAmountSinceCharge()
Get the amount the battery has discharged since the stats were
last reset after charging, as a lower-end approximation.
|
long |
getMobileRadioActiveAdjustedTime(int which)
Returns the time in microseconds that is the difference between the mobile radio
time we saw based on the elapsed timestamp when going down vs. the given time stamp
from the radio.
|
int |
getMobileRadioActiveCount(int which)
Returns the number of times that the mobile network has transitioned to the
active state.
|
long |
getMobileRadioActiveTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the mobile network has been active
(in a high power state).
|
int |
getMobileRadioActiveUnknownCount(int which)
Return count of number of times radio was up that could not be blamed on apps.
|
long |
getMobileRadioActiveUnknownTime(int which)
Returns the time in microseconds that the mobile network has been active
(in a high power state) but not being able to blame on an app.
|
BatteryStats.ControllerActivityCounter |
getModemControllerActivity()
Returns a
BatteryStats.ControllerActivityCounter which is an aggregate of the times spent
in various radio controller states, such as transmit, receive, and idle. |
long |
getNetworkActivityBytes(int type,
int which) |
long |
getNetworkActivityPackets(int type,
int which) |
boolean |
getNextHistoryLocked(BatteryStats.HistoryItem out) |
long |
getNextMaxDailyDeadline() |
long |
getNextMinDailyDeadline() |
boolean |
getNextOldHistoryLocked(BatteryStats.HistoryItem out) |
int |
getNumConnectivityChange(int which)
Returns the number of times that connectivity state changed.
|
BatteryStatsImpl.Uid.Pkg |
getPackageStatsLocked(int uid,
String pkg)
Retrieve the statistics object for a particular process, creating
if needed.
|
int |
getParcelVersion()
Return the internal version code of the parcelled format.
|
int |
getPhoneDataConnectionCount(int dataType,
int which)
Returns the number of times the phone has entered the given data
connection type.
|
long |
getPhoneDataConnectionTime(int dataType,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the phone has been running with
the given data connection.
|
int |
getPhoneOnCount(int which)
Returns the number of times a phone call was activated.
|
long |
getPhoneOnTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the phone has been on while the device was
running on battery.
|
long |
getPhoneSignalScanningTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the phone has been trying to
acquire a signal.
|
int |
getPhoneSignalStrengthCount(int strengthBin,
int which)
Returns the number of times the phone has entered the given signal strength.
|
long |
getPhoneSignalStrengthTime(int strengthBin,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the phone has been running with
the given signal strength.
|
int |
getPowerSaveModeEnabledCount(int which)
Returns the number of times that power save mode was enabled.
|
long |
getPowerSaveModeEnabledTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that power save mode has been enabled while the device was
running on battery.
|
BatteryStatsImpl.Uid.Proc |
getProcessStatsLocked(int uid,
String name)
Retrieve the statistics object for a particular process, creating
if needed.
|
long |
getProcessWakeTime(int uid,
int pid,
long realtime) |
long |
getScreenBrightnessTime(int brightnessBin,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the screen has been on with
the given brightness
|
int |
getScreenOnCount(int which)
Returns the number of times the screen was turned on.
|
long |
getScreenOnTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the screen has been on while the device was
running on battery.
|
BatteryStatsImpl.Uid.Pkg.Serv |
getServiceStatsLocked(int uid,
String pkg,
String name)
Retrieve the statistics object for a particular service, creating
if needed.
|
long |
getStartClockTime()
Return the wall clock time when battery stats data collection started.
|
int |
getStartCount()
Returns the number of times the device has been started.
|
String |
getStartPlatformVersion()
Return platform version tag that we were running in when the battery stats started.
|
SparseArray<? extends BatteryStats.Uid> |
getUidStats()
Returns a SparseArray containing the statistics for each uid.
|
BatteryStatsImpl.Uid |
getUidStatsLocked(int uid)
Retrieve the statistics object for a particular uid, creating if needed.
|
Map<String,? extends BatteryStatsImpl.Timer> |
getWakeupReasonStats() |
BatteryStatsImpl.SamplingTimer |
getWakeupReasonTimerLocked(String name) |
BatteryStats.ControllerActivityCounter |
getWifiControllerActivity()
Returns a
BatteryStats.ControllerActivityCounter which is an aggregate of the times spent
in various radio controller states, such as transmit, receive, and idle. |
long |
getWifiOnTime(long elapsedRealtimeUs,
int which)
Returns the time in microseconds that wifi has been on while the device was
running on battery.
|
int |
getWifiSignalStrengthCount(int strengthBin,
int which)
Returns the number of times WIFI has entered the given signal strength.
|
long |
getWifiSignalStrengthTime(int strengthBin,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that WIFI has been running with
the given signal strength.
|
int |
getWifiStateCount(int wifiState,
int which)
Returns the number of times that WiFi has entered the given state.
|
long |
getWifiStateTime(int wifiState,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that WiFi has been running in the given state.
|
int |
getWifiSupplStateCount(int state,
int which)
Returns the number of times that the wifi supplicant has transitioned
to a given state.
|
long |
getWifiSupplStateTime(int state,
long elapsedRealtimeUs,
int which)
Returns the time in microseconds that the wifi supplicant has been
in a given state.
|
boolean |
hasBluetoothActivityReporting()
Returns true if the BatteryStats object has detailed bluetooth power reports.
|
boolean |
hasModemActivityReporting()
Returns true if the BatteryStats object has detailed modem power reports.
|
boolean |
hasWifiActivityReporting()
Returns true if the BatteryStats object has detailed WiFi power reports.
|
boolean |
isCharging() |
boolean |
isOnBattery() |
boolean |
isScreenOn() |
int |
mapUid(int uid) |
void |
noteActivityPausedLocked(int uid) |
void |
noteActivityResumedLocked(int uid) |
void |
noteAlarmFinishLocked(String name,
int uid) |
void |
noteAlarmStartLocked(String name,
int uid) |
void |
noteAudioOffLocked(int uid) |
void |
noteAudioOnLocked(int uid) |
void |
noteBluetoothScanStartedFromSourceLocked(WorkSource ws) |
void |
noteBluetoothScanStoppedFromSourceLocked(WorkSource ws) |
void |
noteCameraOffLocked(int uid) |
void |
noteCameraOnLocked(int uid) |
void |
noteChangeWakelockFromSourceLocked(WorkSource ws,
int pid,
String name,
String historyName,
int type,
WorkSource newWs,
int newPid,
String newName,
String newHistoryName,
int newType,
boolean newUnimportantForLogging) |
void |
noteConnectivityChangedLocked(int type,
String extra) |
void |
noteCurrentTimeChangedLocked() |
void |
noteDeviceIdleModeLocked(int mode,
String activeReason,
int activeUid) |
void |
noteEventLocked(int code,
String name,
int uid) |
void |
noteFlashlightOffLocked(int uid) |
void |
noteFlashlightOnLocked(int uid) |
void |
noteFullWifiLockAcquiredFromSourceLocked(WorkSource ws) |
void |
noteFullWifiLockAcquiredLocked(int uid) |
void |
noteFullWifiLockReleasedFromSourceLocked(WorkSource ws) |
void |
noteFullWifiLockReleasedLocked(int uid) |
void |
noteInteractiveLocked(boolean interactive) |
void |
noteJobFinishLocked(String name,
int uid) |
void |
noteJobStartLocked(String name,
int uid) |
void |
noteLongPartialWakelockFinish(String name,
String historyName,
int uid) |
void |
noteLongPartialWakelockStart(String name,
String historyName,
int uid) |
void |
noteMobileRadioPowerState(int powerState,
long timestampNs,
int uid) |
void |
noteNetworkInterfaceTypeLocked(String iface,
int networkType) |
void |
noteNetworkStatsEnabledLocked() |
void |
notePackageInstalledLocked(String pkgName,
int versionCode) |
void |
notePackageUninstalledLocked(String pkgName) |
void |
notePhoneDataConnectionStateLocked(int dataType,
boolean hasData) |
void |
notePhoneOffLocked() |
void |
notePhoneOnLocked() |
void |
notePhoneSignalStrengthLocked(SignalStrength signalStrength) |
void |
notePhoneStateLocked(int state,
int simState)
Telephony stack updates the phone state.
|
void |
notePowerSaveMode(boolean enabled) |
void |
noteProcessAnrLocked(String name,
int uid) |
void |
noteProcessCrashLocked(String name,
int uid) |
void |
noteProcessDiedLocked(int uid,
int pid) |
void |
noteProcessFinishLocked(String name,
int uid) |
void |
noteProcessStartLocked(String name,
int uid) |
void |
noteResetAudioLocked() |
void |
noteResetBluetoothScanLocked() |
void |
noteResetCameraLocked() |
void |
noteResetFlashlightLocked() |
void |
noteResetVideoLocked() |
void |
noteScreenBrightnessLocked(int brightness) |
void |
noteScreenStateLocked(int state) |
void |
noteStartGpsLocked(int uid) |
void |
noteStartSensorLocked(int uid,
int sensor) |
void |
noteStartWakeFromSourceLocked(WorkSource ws,
int pid,
String name,
String historyName,
int type,
boolean unimportantForLogging) |
void |
noteStartWakeLocked(int uid,
int pid,
String name,
String historyName,
int type,
boolean unimportantForLogging,
long elapsedRealtime,
long uptime) |
void |
noteStopGpsLocked(int uid) |
void |
noteStopSensorLocked(int uid,
int sensor) |
void |
noteStopWakeFromSourceLocked(WorkSource ws,
int pid,
String name,
String historyName,
int type) |
void |
noteStopWakeLocked(int uid,
int pid,
String name,
String historyName,
int type,
long elapsedRealtime,
long uptime) |
void |
noteSyncFinishLocked(String name,
int uid) |
void |
noteSyncStartLocked(String name,
int uid) |
void |
noteUidProcessStateLocked(int uid,
int state) |
void |
noteUserActivityLocked(int uid,
int event) |
void |
noteVibratorOffLocked(int uid) |
void |
noteVibratorOnLocked(int uid,
long durationMillis) |
void |
noteVideoOffLocked(int uid) |
void |
noteVideoOnLocked(int uid) |
void |
noteWakeUpLocked(String reason,
int reasonUid) |
void |
noteWakeupReasonLocked(String reason) |
void |
noteWifiBatchedScanStartedFromSourceLocked(WorkSource ws,
int csph) |
void |
noteWifiBatchedScanStartedLocked(int uid,
int csph) |
void |
noteWifiBatchedScanStoppedFromSourceLocked(WorkSource ws) |
void |
noteWifiBatchedScanStoppedLocked(int uid) |
void |
noteWifiMulticastDisabledFromSourceLocked(WorkSource ws) |
void |
noteWifiMulticastDisabledLocked(int uid) |
void |
noteWifiMulticastEnabledFromSourceLocked(WorkSource ws) |
void |
noteWifiMulticastEnabledLocked(int uid) |
void |
noteWifiOffLocked() |
void |
noteWifiOnLocked() |
void |
noteWifiRadioPowerState(int powerState,
long timestampNs,
int uid) |
void |
noteWifiRssiChangedLocked(int newRssi) |
void |
noteWifiRunningChangedLocked(WorkSource oldWs,
WorkSource newWs) |
void |
noteWifiRunningLocked(WorkSource ws) |
void |
noteWifiScanStartedFromSourceLocked(WorkSource ws) |
void |
noteWifiScanStartedLocked(int uid) |
void |
noteWifiScanStoppedFromSourceLocked(WorkSource ws) |
void |
noteWifiScanStoppedLocked(int uid) |
void |
noteWifiStateLocked(int wifiState,
String accessPoint) |
void |
noteWifiStoppedLocked(WorkSource ws) |
void |
noteWifiSupplicantStateChangedLocked(int supplState,
boolean failedAuth) |
void |
prepareForDumpLocked() |
void |
pullPendingStateUpdatesLocked() |
void |
readDailyStatsLocked() |
void |
readFromParcel(Parcel in) |
void |
readHistoryDelta(Parcel src,
BatteryStats.HistoryItem cur) |
void |
readLocked() |
void |
readSummaryFromParcel(Parcel in) |
void |
recordDailyStatsIfNeededLocked(boolean settled) |
void |
recordDailyStatsLocked() |
void |
removeIsolatedUidLocked(int isolatedUid)
This should only be called after the cpu times have been read.
|
void |
removeUidStatsLocked(int uid)
Remove the statistics object for a particular uid.
|
void |
reportExcessiveCpuLocked(int uid,
String proc,
long overTime,
long usedTime) |
void |
reportExcessiveWakeLocked(int uid,
String proc,
long overTime,
long usedTime) |
void |
resetAllStatsCmdLocked() |
void |
scheduleRemoveIsolatedUidLocked(int isolatedUid,
int appUid)
Schedules a read of the latest cpu times before removing the isolated UID.
|
void |
setBatteryStateLocked(int status,
int health,
int plugType,
int level,
int temp,
int volt,
int chargeUAh) |
void |
setCallback(BatteryStatsImpl.BatteryCallback cb) |
void |
setNoAutoReset(boolean enabled) |
void |
setPowerProfile(PowerProfile profile) |
void |
setRadioScanningTimeout(long timeout) |
void |
setRecordAllHistoryLocked(boolean enabled) |
void |
shutdownLocked() |
boolean |
startAddingCpuLocked() |
boolean |
startIteratingHistoryLocked() |
boolean |
startIteratingOldHistoryLocked() |
void |
updateBluetoothStateLocked(BluetoothActivityEnergyInfo info)
Distribute Bluetooth energy info and network traffic to apps.
|
void |
updateCpuTimeLocked()
Read and distribute CPU usage across apps.
|
void |
updateDailyDeadlineLocked() |
void |
updateKernelWakelocksLocked()
Read and distribute kernel wake lock use across apps.
|
void |
updateMobileRadioStateLocked(long elapsedRealtimeMs,
ModemActivityInfo activityInfo)
Distribute Cell radio energy info and network traffic to apps.
|
void |
updateTimeBasesLocked(boolean unplugged,
boolean screenOff,
long uptime,
long realtime) |
void |
updateWifiStateLocked(WifiActivityEnergyInfo info)
Distribute WiFi energy info and network traffic to apps.
|
void |
writeAsyncLocked() |
void |
writeHistoryDelta(Parcel dest,
BatteryStats.HistoryItem cur,
BatteryStats.HistoryItem last) |
void |
writeSummaryToParcel(Parcel out,
boolean inclHistory)
Writes a summary of the statistics to a Parcel, in a format suitable to be written to
disk.
|
void |
writeSyncLocked() |
void |
writeToParcel(Parcel out,
int flags)
Flatten this object in to a Parcel.
|
void |
writeToParcelWithoutUids(Parcel out,
int flags) |
dumpCheckinLocked, dumpCheckinLocked, dumpCheckinLocked, dumpLocked, dumpLocked, formatRatioLocked, formatTimeMs, formatTimeMsNoSpace
public static final boolean DEBUG_ENERGY
protected BatteryStatsImpl.Clocks mClocks
public final AtomicFile mCheckinFile
public final AtomicFile mDailyFile
public final com.android.internal.os.BatteryStatsImpl.MyHandler mHandler
protected final BatteryStatsImpl.TimeBase mOnBatteryTimeBase
public boolean mRecordAllHistory
public static final int BATTERY_PLUGGED_NONE
public static final Parcelable.Creator<BatteryStatsImpl> CREATOR
public BatteryStatsImpl()
public BatteryStatsImpl(BatteryStatsImpl.Clocks clocks)
public BatteryStatsImpl(File systemDir, Handler handler, BatteryStatsImpl.ExternalStatsSync externalSync)
public BatteryStatsImpl(File systemDir, Handler handler, BatteryStatsImpl.ExternalStatsSync externalSync, BatteryStatsImpl.PlatformIdleStateCallback cb)
public BatteryStatsImpl(BatteryStatsImpl.Clocks clocks, File systemDir, Handler handler, BatteryStatsImpl.ExternalStatsSync externalSync, BatteryStatsImpl.PlatformIdleStateCallback cb)
public BatteryStatsImpl(Parcel p)
public BatteryStatsImpl(BatteryStatsImpl.Clocks clocks, Parcel p)
public Map<String,? extends BatteryStatsImpl.Timer> getKernelWakelockStats()
getKernelWakelockStats
in class BatteryStats
public Map<String,? extends BatteryStatsImpl.Timer> getWakeupReasonStats()
getWakeupReasonStats
in class BatteryStats
public BatteryStats.LongCounter getDischargeScreenOffCoulombCounter()
BatteryStats
getDischargeScreenOffCoulombCounter
in class BatteryStats
public BatteryStats.LongCounter getDischargeCoulombCounter()
BatteryStats
getDischargeCoulombCounter
in class BatteryStats
public int getEstimatedBatteryCapacity()
BatteryStats
getEstimatedBatteryCapacity
in class BatteryStats
public BatteryStatsImpl.SamplingTimer getWakeupReasonTimerLocked(String name)
public BatteryStatsImpl.SamplingTimer getKernelWakelockTimerLocked(String name)
public void writeHistoryDelta(Parcel dest, BatteryStats.HistoryItem cur, BatteryStats.HistoryItem last)
public void readHistoryDelta(Parcel src, BatteryStats.HistoryItem cur)
public void commitCurrentHistoryBatchLocked()
BatteryStats
commitCurrentHistoryBatchLocked
in class BatteryStats
public void addHistoryEventLocked(long elapsedRealtimeMs, long uptimeMs, int code, String name, int uid)
public void updateTimeBasesLocked(boolean unplugged, boolean screenOff, long uptime, long realtime)
public void addIsolatedUidLocked(int isolatedUid, int appUid)
public void scheduleRemoveIsolatedUidLocked(int isolatedUid, int appUid)
removeIsolatedUidLocked(int)
public void removeIsolatedUidLocked(int isolatedUid)
public int mapUid(int uid)
public void noteEventLocked(int code, String name, int uid)
public void noteCurrentTimeChangedLocked()
public void noteProcessStartLocked(String name, int uid)
public void noteProcessCrashLocked(String name, int uid)
public void noteProcessAnrLocked(String name, int uid)
public void noteUidProcessStateLocked(int uid, int state)
public void noteProcessFinishLocked(String name, int uid)
public void noteSyncStartLocked(String name, int uid)
public void noteSyncFinishLocked(String name, int uid)
public void noteJobStartLocked(String name, int uid)
public void noteJobFinishLocked(String name, int uid)
public void noteAlarmStartLocked(String name, int uid)
public void noteAlarmFinishLocked(String name, int uid)
public void setRecordAllHistoryLocked(boolean enabled)
public void setNoAutoReset(boolean enabled)
public void noteStartWakeLocked(int uid, int pid, String name, String historyName, int type, boolean unimportantForLogging, long elapsedRealtime, long uptime)
public void noteStopWakeLocked(int uid, int pid, String name, String historyName, int type, long elapsedRealtime, long uptime)
public void noteStartWakeFromSourceLocked(WorkSource ws, int pid, String name, String historyName, int type, boolean unimportantForLogging)
public void noteChangeWakelockFromSourceLocked(WorkSource ws, int pid, String name, String historyName, int type, WorkSource newWs, int newPid, String newName, String newHistoryName, int newType, boolean newUnimportantForLogging)
public void noteStopWakeFromSourceLocked(WorkSource ws, int pid, String name, String historyName, int type)
public void noteLongPartialWakelockStart(String name, String historyName, int uid)
public void noteLongPartialWakelockFinish(String name, String historyName, int uid)
public void noteWakeupReasonLocked(String reason)
public boolean startAddingCpuLocked()
public void finishAddingCpuLocked(int totalUTime, int totalSTime, int statUserTime, int statSystemTime, int statIOWaitTime, int statIrqTime, int statSoftIrqTime, int statIdleTime)
public void noteProcessDiedLocked(int uid, int pid)
public long getProcessWakeTime(int uid, int pid, long realtime)
public void reportExcessiveWakeLocked(int uid, String proc, long overTime, long usedTime)
public void reportExcessiveCpuLocked(int uid, String proc, long overTime, long usedTime)
public void noteStartSensorLocked(int uid, int sensor)
public void noteStopSensorLocked(int uid, int sensor)
public void noteStartGpsLocked(int uid)
public void noteStopGpsLocked(int uid)
public void noteScreenStateLocked(int state)
public void noteScreenBrightnessLocked(int brightness)
public void noteUserActivityLocked(int uid, int event)
public void noteWakeUpLocked(String reason, int reasonUid)
public void noteInteractiveLocked(boolean interactive)
public void noteConnectivityChangedLocked(int type, String extra)
public void noteMobileRadioPowerState(int powerState, long timestampNs, int uid)
public void notePowerSaveMode(boolean enabled)
public void noteDeviceIdleModeLocked(int mode, String activeReason, int activeUid)
public void notePackageInstalledLocked(String pkgName, int versionCode)
public void notePackageUninstalledLocked(String pkgName)
public void notePhoneOnLocked()
public void notePhoneOffLocked()
public void notePhoneStateLocked(int state, int simState)
state
- phone state from ServiceState.getState()public void notePhoneSignalStrengthLocked(SignalStrength signalStrength)
public void notePhoneDataConnectionStateLocked(int dataType, boolean hasData)
public void noteWifiOnLocked()
public void noteWifiOffLocked()
public void noteAudioOnLocked(int uid)
public void noteAudioOffLocked(int uid)
public void noteVideoOnLocked(int uid)
public void noteVideoOffLocked(int uid)
public void noteResetAudioLocked()
public void noteResetVideoLocked()
public void noteActivityResumedLocked(int uid)
public void noteActivityPausedLocked(int uid)
public void noteVibratorOnLocked(int uid, long durationMillis)
public void noteVibratorOffLocked(int uid)
public void noteFlashlightOnLocked(int uid)
public void noteFlashlightOffLocked(int uid)
public void noteCameraOnLocked(int uid)
public void noteCameraOffLocked(int uid)
public void noteResetCameraLocked()
public void noteResetFlashlightLocked()
public void noteBluetoothScanStartedFromSourceLocked(WorkSource ws)
public void noteBluetoothScanStoppedFromSourceLocked(WorkSource ws)
public void noteResetBluetoothScanLocked()
public void noteWifiRadioPowerState(int powerState, long timestampNs, int uid)
public void noteWifiRunningLocked(WorkSource ws)
public void noteWifiRunningChangedLocked(WorkSource oldWs, WorkSource newWs)
public void noteWifiStoppedLocked(WorkSource ws)
public void noteWifiStateLocked(int wifiState, String accessPoint)
public void noteWifiSupplicantStateChangedLocked(int supplState, boolean failedAuth)
public void noteWifiRssiChangedLocked(int newRssi)
public void noteFullWifiLockAcquiredLocked(int uid)
public void noteFullWifiLockReleasedLocked(int uid)
public void noteWifiScanStartedLocked(int uid)
public void noteWifiScanStoppedLocked(int uid)
public void noteWifiBatchedScanStartedLocked(int uid, int csph)
public void noteWifiBatchedScanStoppedLocked(int uid)
public void noteWifiMulticastEnabledLocked(int uid)
public void noteWifiMulticastDisabledLocked(int uid)
public void noteFullWifiLockAcquiredFromSourceLocked(WorkSource ws)
public void noteFullWifiLockReleasedFromSourceLocked(WorkSource ws)
public void noteWifiScanStartedFromSourceLocked(WorkSource ws)
public void noteWifiScanStoppedFromSourceLocked(WorkSource ws)
public void noteWifiBatchedScanStartedFromSourceLocked(WorkSource ws, int csph)
public void noteWifiBatchedScanStoppedFromSourceLocked(WorkSource ws)
public void noteWifiMulticastEnabledFromSourceLocked(WorkSource ws)
public void noteWifiMulticastDisabledFromSourceLocked(WorkSource ws)
public void noteNetworkInterfaceTypeLocked(String iface, int networkType)
public void noteNetworkStatsEnabledLocked()
public long getScreenOnTime(long elapsedRealtimeUs, int which)
BatteryStats
getScreenOnTime
in class BatteryStats
public int getScreenOnCount(int which)
BatteryStats
getScreenOnCount
in class BatteryStats
public long getScreenBrightnessTime(int brightnessBin, long elapsedRealtimeUs, int which)
BatteryStats
getScreenBrightnessTime
in class BatteryStats
public long getInteractiveTime(long elapsedRealtimeUs, int which)
getInteractiveTime
in class BatteryStats
public long getPowerSaveModeEnabledTime(long elapsedRealtimeUs, int which)
BatteryStats
getPowerSaveModeEnabledTime
in class BatteryStats
public int getPowerSaveModeEnabledCount(int which)
BatteryStats
getPowerSaveModeEnabledCount
in class BatteryStats
public long getDeviceIdleModeTime(int mode, long elapsedRealtimeUs, int which)
BatteryStats
getDeviceIdleModeTime
in class BatteryStats
public int getDeviceIdleModeCount(int mode, int which)
BatteryStats
getDeviceIdleModeCount
in class BatteryStats
public long getLongestDeviceIdleModeTime(int mode)
BatteryStats
getLongestDeviceIdleModeTime
in class BatteryStats
public long getDeviceIdlingTime(int mode, long elapsedRealtimeUs, int which)
BatteryStats
BatteryStats.getDeviceIdleModeTime(int, long, int)
-- it
counts all of the time that we consider the device to be idle, whether or not
it is currently in the actual device idle mode.
getDeviceIdlingTime
in class BatteryStats
public int getDeviceIdlingCount(int mode, int which)
BatteryStats
getDeviceIdlingCount
in class BatteryStats
public int getNumConnectivityChange(int which)
BatteryStats
getNumConnectivityChange
in class BatteryStats
public long getPhoneOnTime(long elapsedRealtimeUs, int which)
BatteryStats
getPhoneOnTime
in class BatteryStats
public int getPhoneOnCount(int which)
BatteryStats
getPhoneOnCount
in class BatteryStats
public long getPhoneSignalStrengthTime(int strengthBin, long elapsedRealtimeUs, int which)
BatteryStats
getPhoneSignalStrengthTime
in class BatteryStats
public long getPhoneSignalScanningTime(long elapsedRealtimeUs, int which)
BatteryStats
getPhoneSignalScanningTime
in class BatteryStats
public int getPhoneSignalStrengthCount(int strengthBin, int which)
BatteryStats
getPhoneSignalStrengthCount
in class BatteryStats
public long getPhoneDataConnectionTime(int dataType, long elapsedRealtimeUs, int which)
BatteryStats
getPhoneDataConnectionTime
in class BatteryStats
public int getPhoneDataConnectionCount(int dataType, int which)
BatteryStats
getPhoneDataConnectionCount
in class BatteryStats
public long getMobileRadioActiveTime(long elapsedRealtimeUs, int which)
BatteryStats
getMobileRadioActiveTime
in class BatteryStats
public int getMobileRadioActiveCount(int which)
BatteryStats
getMobileRadioActiveCount
in class BatteryStats
public long getMobileRadioActiveAdjustedTime(int which)
BatteryStats
getMobileRadioActiveAdjustedTime
in class BatteryStats
public long getMobileRadioActiveUnknownTime(int which)
BatteryStats
getMobileRadioActiveUnknownTime
in class BatteryStats
public int getMobileRadioActiveUnknownCount(int which)
BatteryStats
getMobileRadioActiveUnknownCount
in class BatteryStats
public long getWifiOnTime(long elapsedRealtimeUs, int which)
BatteryStats
getWifiOnTime
in class BatteryStats
public long getGlobalWifiRunningTime(long elapsedRealtimeUs, int which)
BatteryStats
getGlobalWifiRunningTime
in class BatteryStats
public long getWifiStateTime(int wifiState, long elapsedRealtimeUs, int which)
BatteryStats
getWifiStateTime
in class BatteryStats
public int getWifiStateCount(int wifiState, int which)
BatteryStats
getWifiStateCount
in class BatteryStats
public long getWifiSupplStateTime(int state, long elapsedRealtimeUs, int which)
BatteryStats
getWifiSupplStateTime
in class BatteryStats
public int getWifiSupplStateCount(int state, int which)
BatteryStats
getWifiSupplStateCount
in class BatteryStats
public long getWifiSignalStrengthTime(int strengthBin, long elapsedRealtimeUs, int which)
BatteryStats
getWifiSignalStrengthTime
in class BatteryStats
public int getWifiSignalStrengthCount(int strengthBin, int which)
BatteryStats
getWifiSignalStrengthCount
in class BatteryStats
public BatteryStats.ControllerActivityCounter getBluetoothControllerActivity()
BatteryStats
BatteryStats.ControllerActivityCounter
which is an aggregate of the times spent
in various radio controller states, such as transmit, receive, and idle.getBluetoothControllerActivity
in class BatteryStats
BatteryStats.ControllerActivityCounter
public BatteryStats.ControllerActivityCounter getWifiControllerActivity()
BatteryStats
BatteryStats.ControllerActivityCounter
which is an aggregate of the times spent
in various radio controller states, such as transmit, receive, and idle.getWifiControllerActivity
in class BatteryStats
BatteryStats.ControllerActivityCounter
public BatteryStats.ControllerActivityCounter getModemControllerActivity()
BatteryStats
BatteryStats.ControllerActivityCounter
which is an aggregate of the times spent
in various radio controller states, such as transmit, receive, and idle.getModemControllerActivity
in class BatteryStats
BatteryStats.ControllerActivityCounter
public boolean hasBluetoothActivityReporting()
BatteryStats
BatteryStats.getBluetoothControllerActivity()
will yield the
actual power data.hasBluetoothActivityReporting
in class BatteryStats
public boolean hasWifiActivityReporting()
BatteryStats
BatteryStats.getWifiControllerActivity()
will yield the
actual power data.hasWifiActivityReporting
in class BatteryStats
public boolean hasModemActivityReporting()
BatteryStats
BatteryStats.getModemControllerActivity()
will yield the
actual power data.hasModemActivityReporting
in class BatteryStats
public long getFlashlightOnTime(long elapsedRealtimeUs, int which)
BatteryStats
getFlashlightOnTime
in class BatteryStats
public long getFlashlightOnCount(int which)
BatteryStats
getFlashlightOnCount
in class BatteryStats
public long getCameraOnTime(long elapsedRealtimeUs, int which)
BatteryStats
getCameraOnTime
in class BatteryStats
public long getBluetoothScanTime(long elapsedRealtimeUs, int which)
BatteryStats
getBluetoothScanTime
in class BatteryStats
public long getNetworkActivityBytes(int type, int which)
getNetworkActivityBytes
in class BatteryStats
public long getNetworkActivityPackets(int type, int which)
getNetworkActivityPackets
in class BatteryStats
public long getStartClockTime()
BatteryStats
getStartClockTime
in class BatteryStats
public String getStartPlatformVersion()
BatteryStats
getStartPlatformVersion
in class BatteryStats
public String getEndPlatformVersion()
BatteryStats
getEndPlatformVersion
in class BatteryStats
public int getParcelVersion()
BatteryStats
getParcelVersion
in class BatteryStats
public boolean getIsOnBattery()
BatteryStats
getIsOnBattery
in class BatteryStats
public SparseArray<? extends BatteryStats.Uid> getUidStats()
BatteryStats
getUidStats
in class BatteryStats
public void setPowerProfile(PowerProfile profile)
public void setCallback(BatteryStatsImpl.BatteryCallback cb)
public void setRadioScanningTimeout(long timeout)
public void updateDailyDeadlineLocked()
public void recordDailyStatsIfNeededLocked(boolean settled)
public void recordDailyStatsLocked()
public void readDailyStatsLocked()
public BatteryStats.DailyItem getDailyItemLocked(int daysAgo)
getDailyItemLocked
in class BatteryStats
public long getCurrentDailyStartTime()
getCurrentDailyStartTime
in class BatteryStats
public long getNextMinDailyDeadline()
getNextMinDailyDeadline
in class BatteryStats
public long getNextMaxDailyDeadline()
getNextMaxDailyDeadline
in class BatteryStats
public boolean startIteratingOldHistoryLocked()
startIteratingOldHistoryLocked
in class BatteryStats
public boolean getNextOldHistoryLocked(BatteryStats.HistoryItem out)
getNextOldHistoryLocked
in class BatteryStats
public void finishIteratingOldHistoryLocked()
finishIteratingOldHistoryLocked
in class BatteryStats
public int getHistoryTotalSize()
getHistoryTotalSize
in class BatteryStats
public int getHistoryUsedSize()
getHistoryUsedSize
in class BatteryStats
public boolean startIteratingHistoryLocked()
startIteratingHistoryLocked
in class BatteryStats
public int getHistoryStringPoolSize()
getHistoryStringPoolSize
in class BatteryStats
public int getHistoryStringPoolBytes()
getHistoryStringPoolBytes
in class BatteryStats
public String getHistoryTagPoolString(int index)
getHistoryTagPoolString
in class BatteryStats
public int getHistoryTagPoolUid(int index)
getHistoryTagPoolUid
in class BatteryStats
public boolean getNextHistoryLocked(BatteryStats.HistoryItem out)
getNextHistoryLocked
in class BatteryStats
public void finishIteratingHistoryLocked()
finishIteratingHistoryLocked
in class BatteryStats
public long getHistoryBaseTime()
BatteryStats
getHistoryBaseTime
in class BatteryStats
public int getStartCount()
BatteryStats
getStartCount
in class BatteryStats
public boolean isOnBattery()
public boolean isCharging()
public boolean isScreenOn()
public void resetAllStatsCmdLocked()
public void pullPendingStateUpdatesLocked()
public void updateWifiStateLocked(WifiActivityEnergyInfo info)
info
- The energy information from the WiFi controller.public void updateMobileRadioStateLocked(long elapsedRealtimeMs, ModemActivityInfo activityInfo)
public void updateBluetoothStateLocked(BluetoothActivityEnergyInfo info)
info
- The energy information from the bluetooth controller.public void updateKernelWakelocksLocked()
public void updateCpuTimeLocked()
public void setBatteryStateLocked(int status, int health, int plugType, int level, int temp, int volt, int chargeUAh)
public long getAwakeTimeBattery()
public long getAwakeTimePlugged()
public long computeUptime(long curTime, int which)
BatteryStats
computeUptime
in class BatteryStats
curTime
- the current elapsed realtime in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long computeRealtime(long curTime, int which)
BatteryStats
computeRealtime
in class BatteryStats
curTime
- the current elapsed realtime in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long computeBatteryUptime(long curTime, int which)
BatteryStats
computeBatteryUptime
in class BatteryStats
curTime
- the elapsed realtime in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long computeBatteryRealtime(long curTime, int which)
BatteryStats
computeBatteryRealtime
in class BatteryStats
curTime
- the current elapsed realtime in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long computeBatteryScreenOffUptime(long curTime, int which)
BatteryStats
computeBatteryScreenOffUptime
in class BatteryStats
curTime
- the elapsed realtime in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long computeBatteryScreenOffRealtime(long curTime, int which)
BatteryStats
computeBatteryScreenOffRealtime
in class BatteryStats
curTime
- the current elapsed realtime in microseconds.which
- one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT.public long computeBatteryTimeRemaining(long curTime)
BatteryStats
computeBatteryTimeRemaining
in class BatteryStats
curTime
- The current elepsed realtime in microseconds.public BatteryStats.LevelStepTracker getDischargeLevelStepTracker()
BatteryStats
getDischargeLevelStepTracker
in class BatteryStats
public BatteryStats.LevelStepTracker getDailyDischargeLevelStepTracker()
BatteryStats
getDailyDischargeLevelStepTracker
in class BatteryStats
public long computeChargeTimeRemaining(long curTime)
BatteryStats
computeChargeTimeRemaining
in class BatteryStats
curTime
- The current elepsed realtime in microseconds.public BatteryStats.LevelStepTracker getChargeLevelStepTracker()
BatteryStats
getChargeLevelStepTracker
in class BatteryStats
public BatteryStats.LevelStepTracker getDailyChargeLevelStepTracker()
BatteryStats
getDailyChargeLevelStepTracker
in class BatteryStats
public ArrayList<BatteryStats.PackageChange> getDailyPackageChanges()
getDailyPackageChanges
in class BatteryStats
protected long getBatteryUptimeLocked()
public long getBatteryUptime(long curTime)
BatteryStats
getBatteryUptime
in class BatteryStats
curTime
- the amount of elapsed realtime in microseconds.public long getBatteryRealtime(long curTime)
BatteryStats
getBatteryRealtime
in class BatteryStats
curTime
- the amount of elapsed realtime in microseconds.public int getDischargeStartLevel()
BatteryStats
getDischargeStartLevel
in class BatteryStats
public int getDischargeStartLevelLocked()
public int getDischargeCurrentLevel()
BatteryStats
getDischargeCurrentLevel
in class BatteryStats
public int getDischargeCurrentLevelLocked()
public int getLowDischargeAmountSinceCharge()
BatteryStats
getLowDischargeAmountSinceCharge
in class BatteryStats
public int getHighDischargeAmountSinceCharge()
BatteryStats
getHighDischargeAmountSinceCharge
in class BatteryStats
public int getDischargeAmount(int which)
BatteryStats
getDischargeAmount
in class BatteryStats
public int getDischargeAmountScreenOn()
BatteryStats
getDischargeAmountScreenOn
in class BatteryStats
public int getDischargeAmountScreenOnSinceCharge()
BatteryStats
getDischargeAmountScreenOnSinceCharge
in class BatteryStats
public int getDischargeAmountScreenOff()
BatteryStats
getDischargeAmountScreenOff
in class BatteryStats
public int getDischargeAmountScreenOffSinceCharge()
BatteryStats
getDischargeAmountScreenOffSinceCharge
in class BatteryStats
public BatteryStatsImpl.Uid getUidStatsLocked(int uid)
public void removeUidStatsLocked(int uid)
public BatteryStatsImpl.Uid.Proc getProcessStatsLocked(int uid, String name)
public BatteryStatsImpl.Uid.Pkg getPackageStatsLocked(int uid, String pkg)
public BatteryStatsImpl.Uid.Pkg.Serv getServiceStatsLocked(int uid, String pkg, String name)
public void shutdownLocked()
public void writeAsyncLocked()
public void writeSyncLocked()
public void commitPendingDataToDisk()
public void readLocked()
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.Parcelable.CONTENTS_FILE_DESCRIPTOR
public void readSummaryFromParcel(Parcel in) throws ParcelFormatException
ParcelFormatException
public void writeSummaryToParcel(Parcel out, boolean inclHistory)
out
- the Parcel to be written to.public void readFromParcel(Parcel in)
public void writeToParcel(Parcel out, int flags)
Parcelable
out
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public void writeToParcelWithoutUids(Parcel out, int flags)
writeToParcelWithoutUids
in class BatteryStats
public void prepareForDumpLocked()
prepareForDumpLocked
in class BatteryStats
public void dumpLocked(Context context, PrintWriter pw, int flags, int reqUid, long histStart)
BatteryStats
dumpLocked
in class BatteryStats
pw
- a Printer to receive the dump output.