/**@class android.os.BatteryStats implements android.os.Parcelable @extends java.lang.Object A class providing access to battery usage statistics, including information on wakelocks, processes, packages, and services. All times are represented in microseconds except where indicated otherwise. @hide */ var BatteryStats = { /**@hide */ SERVICE_NAME : "batterystats", /** A constant indicating a partial wake lock timer. */ WAKE_TYPE_PARTIAL : "0", /** A constant indicating a full wake lock timer. */ WAKE_TYPE_FULL : "1", /** A constant indicating a window wake lock timer. */ WAKE_TYPE_WINDOW : "2", /** A constant indicating a sensor timer. */ SENSOR : "3", /** A constant indicating a a wifi running timer */ WIFI_RUNNING : "4", /** A constant indicating a full wifi lock timer */ FULL_WIFI_LOCK : "5", /** A constant indicating a wifi scan */ WIFI_SCAN : "6", /** A constant indicating a wifi multicast timer */ WIFI_MULTICAST_ENABLED : "7", /** A constant indicating a video turn on timer */ VIDEO_TURNED_ON : "8", /** A constant indicating a vibrator on timer */ VIBRATOR_ON : "9", /** A constant indicating a foreground activity timer */ FOREGROUND_ACTIVITY : "10", /** A constant indicating a wifi batched scan is active */ WIFI_BATCHED_SCAN : "11", /** A constant indicating a process state timer */ PROCESS_STATE : "12", /** A constant indicating a sync timer */ SYNC : "13", /** A constant indicating a job timer */ JOB : "14", /** A constant indicating an audio turn on timer */ AUDIO_TURNED_ON : "15", /** A constant indicating a flashlight turn on timer */ FLASHLIGHT_TURNED_ON : "16", /** A constant indicating a camera turn on timer */ CAMERA_TURNED_ON : "17", /** A constant indicating a draw wake lock timer. */ WAKE_TYPE_DRAW : "18", /** Include all of the data in the stats, including previously saved data. */ STATS_SINCE_CHARGED : "0", /** Include only the current run in the stats. */ STATS_CURRENT : "1", /** Include only the run since the last time the device was unplugged in the stats. */ STATS_SINCE_UNPLUGGED : "2", /***/ SCREEN_BRIGHTNESS_DARK : "0", /***/ SCREEN_BRIGHTNESS_DIM : "1", /***/ SCREEN_BRIGHTNESS_MEDIUM : "2", /***/ SCREEN_BRIGHTNESS_LIGHT : "3", /***/ SCREEN_BRIGHTNESS_BRIGHT : "4", /***/ NUM_SCREEN_BRIGHTNESS_BINS : "5", /***/ DATA_CONNECTION_NONE : "0", /***/ DATA_CONNECTION_GPRS : "1", /***/ DATA_CONNECTION_EDGE : "2", /***/ DATA_CONNECTION_UMTS : "3", /***/ DATA_CONNECTION_CDMA : "4", /***/ DATA_CONNECTION_EVDO_0 : "5", /***/ DATA_CONNECTION_EVDO_A : "6", /***/ DATA_CONNECTION_1xRTT : "7", /***/ DATA_CONNECTION_HSDPA : "8", /***/ DATA_CONNECTION_HSUPA : "9", /***/ DATA_CONNECTION_HSPA : "10", /***/ DATA_CONNECTION_IDEN : "11", /***/ DATA_CONNECTION_EVDO_B : "12", /***/ DATA_CONNECTION_LTE : "13", /***/ DATA_CONNECTION_EHRPD : "14", /***/ DATA_CONNECTION_HSPAP : "15", /***/ DATA_CONNECTION_OTHER : "16", /***/ NUM_DATA_CONNECTION_TYPES : "17", /***/ WIFI_SUPPL_STATE_INVALID : "0", /***/ WIFI_SUPPL_STATE_DISCONNECTED : "1", /***/ WIFI_SUPPL_STATE_INTERFACE_DISABLED : "2", /***/ WIFI_SUPPL_STATE_INACTIVE : "3", /***/ WIFI_SUPPL_STATE_SCANNING : "4", /***/ WIFI_SUPPL_STATE_AUTHENTICATING : "5", /***/ WIFI_SUPPL_STATE_ASSOCIATING : "6", /***/ WIFI_SUPPL_STATE_ASSOCIATED : "7", /***/ WIFI_SUPPL_STATE_FOUR_WAY_HANDSHAKE : "8", /***/ WIFI_SUPPL_STATE_GROUP_HANDSHAKE : "9", /***/ WIFI_SUPPL_STATE_COMPLETED : "10", /***/ WIFI_SUPPL_STATE_DORMANT : "11", /***/ WIFI_SUPPL_STATE_UNINITIALIZED : "12", /***/ NUM_WIFI_SUPPL_STATES : "13", /***/ HISTORY_STATE_DESCRIPTIONS : "null", /***/ HISTORY_STATE2_DESCRIPTIONS : "null", /***/ HISTORY_EVENT_NAMES : "null", /***/ HISTORY_EVENT_CHECKIN_NAMES : "null", /***/ WIFI_STATE_OFF : "0", /***/ WIFI_STATE_OFF_SCANNING : "1", /***/ WIFI_STATE_ON_NO_NETWORKS : "2", /***/ WIFI_STATE_ON_DISCONNECTED : "3", /***/ WIFI_STATE_ON_CONNECTED_STA : "4", /***/ WIFI_STATE_ON_CONNECTED_P2P : "5", /***/ WIFI_STATE_ON_CONNECTED_STA_P2P : "6", /***/ WIFI_STATE_SOFT_AP : "7", /***/ NUM_WIFI_STATES : "8", /***/ NUM_WIFI_SIGNAL_STRENGTH_BINS : "5", /***/ NETWORK_MOBILE_RX_DATA : "0", /***/ NETWORK_MOBILE_TX_DATA : "1", /***/ NETWORK_WIFI_RX_DATA : "2", /***/ NETWORK_WIFI_TX_DATA : "3", /***/ NUM_NETWORK_ACTIVITY_TYPES : "4", /***/ CONTROLLER_IDLE_TIME : "0", /***/ CONTROLLER_RX_TIME : "1", /***/ CONTROLLER_TX_TIME : "2", /***/ CONTROLLER_POWER_DRAIN : "3", /***/ NUM_CONTROLLER_ACTIVITY_TYPES : "4", /***/ STEP_LEVEL_TIME_MASK : "1099511627775", /***/ STEP_LEVEL_LEVEL_MASK : "280375465082880", /***/ STEP_LEVEL_LEVEL_SHIFT : "40", /***/ STEP_LEVEL_INITIAL_MODE_MASK : "71776119061217280", /***/ STEP_LEVEL_INITIAL_MODE_SHIFT : "48", /***/ STEP_LEVEL_MODIFIED_MODE_MASK : "-72057594037927936", /***/ STEP_LEVEL_MODIFIED_MODE_SHIFT : "56", /***/ STEP_LEVEL_MODE_SCREEN_STATE : "3", /***/ STEP_LEVEL_MODE_POWER_SAVE : "4", /***/ STEP_LEVEL_MODE_DEVICE_IDLE : "8", /***/ STEP_LEVEL_MODES_OF_INTEREST : "null", /***/ STEP_LEVEL_MODE_VALUES : "null", /***/ STEP_LEVEL_MODE_LABELS : "null", /***/ DUMP_CHARGED_ONLY : "2", /***/ DUMP_DAILY_ONLY : "4", /***/ DUMP_HISTORY_ONLY : "8", /***/ DUMP_INCLUDE_HISTORY : "16", /***/ DUMP_VERBOSE : "32", /***/ DUMP_DEVICE_WIFI_ONLY : "64", /** */ getDailyItemLocked : function( ) {}, /** */ getCurrentDailyStartTime : function( ) {}, /** */ getNextMinDailyDeadline : function( ) {}, /** */ getNextMaxDailyDeadline : function( ) {}, /**Don't allow any more batching in to the current history event. This is called when printing partial histories, so to ensure that the next history event will go in to a new batch after what was printed in the last partial history. */ commitCurrentHistoryBatchLocked : function( ) {}, /** */ getHistoryTotalSize : function( ) {}, /** */ getHistoryUsedSize : function( ) {}, /** */ startIteratingHistoryLocked : function( ) {}, /** */ getHistoryStringPoolSize : function( ) {}, /** */ getHistoryStringPoolBytes : function( ) {}, /** */ getHistoryTagPoolString : function( ) {}, /** */ getHistoryTagPoolUid : function( ) {}, /** */ getNextHistoryLocked : function( ) {}, /** */ finishIteratingHistoryLocked : function( ) {}, /** */ startIteratingOldHistoryLocked : function( ) {}, /** */ getNextOldHistoryLocked : function( ) {}, /** */ finishIteratingOldHistoryLocked : function( ) {}, /**Return the base time offset for the battery history. */ getHistoryBaseTime : function( ) {}, /**Returns the number of times the device has been started. */ getStartCount : function( ) {}, /**Returns the time in microseconds that the screen has been on while the device was running on battery. {@hide} */ getScreenOnTime : function( ) {}, /**Returns the number of times the screen was turned on. {@hide} */ getScreenOnCount : function( ) {}, /** */ getInteractiveTime : function( ) {}, /**Returns the time in microseconds that the screen has been on with the given brightness {@hide} */ getScreenBrightnessTime : function( ) {}, /**Returns the time in microseconds that power save mode has been enabled while the device was running on battery. {@hide} */ getPowerSaveModeEnabledTime : function( ) {}, /**Returns the number of times that power save mode was enabled. {@hide} */ getPowerSaveModeEnabledCount : function( ) {}, /**Returns the time in microseconds that device has been in idle mode while running on battery. {@hide} */ getDeviceIdleModeEnabledTime : function( ) {}, /**Returns the number of times that the devie has gone in to idle mode. {@hide} */ getDeviceIdleModeEnabledCount : function( ) {}, /**Returns the time in microseconds that device has been in idling while on battery. This is broader than {@link #getDeviceIdleModeEnabledTime} -- 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. {@hide} */ getDeviceIdlingTime : function( ) {}, /**Returns the number of times that the devie has started idling. {@hide} */ getDeviceIdlingCount : function( ) {}, /**Returns the number of times that connectivity state changed. {@hide} */ getNumConnectivityChange : function( ) {}, /**Returns the time in microseconds that the phone has been on while the device was running on battery. {@hide} */ getPhoneOnTime : function( ) {}, /**Returns the number of times a phone call was activated. {@hide} */ getPhoneOnCount : function( ) {}, /**Returns the time in microseconds that the phone has been running with the given signal strength. {@hide} */ getPhoneSignalStrengthTime : function( ) {}, /**Returns the time in microseconds that the phone has been trying to acquire a signal. {@hide} */ getPhoneSignalScanningTime : function( ) {}, /**Returns the number of times the phone has entered the given signal strength. {@hide} */ getPhoneSignalStrengthCount : function( ) {}, /**Returns the time in microseconds that the mobile network has been active (in a high power state). {@hide} */ getMobileRadioActiveTime : function( ) {}, /**Returns the number of times that the mobile network has transitioned to the active state. {@hide} */ getMobileRadioActiveCount : function( ) {}, /**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. {@hide} */ getMobileRadioActiveAdjustedTime : function( ) {}, /**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. {@hide} */ getMobileRadioActiveUnknownTime : function( ) {}, /**Return count of number of times radio was up that could not be blamed on apps. {@hide} */ getMobileRadioActiveUnknownCount : function( ) {}, /**Returns the time in microseconds that the phone has been running with the given data connection. {@hide} */ getPhoneDataConnectionTime : function( ) {}, /**Returns the number of times the phone has entered the given data connection type. {@hide} */ getPhoneDataConnectionCount : function( ) {}, /**Returns the time in microseconds that wifi has been on while the device was running on battery. {@hide} */ getWifiOnTime : function( ) {}, /**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. {@hide} */ getGlobalWifiRunningTime : function( ) {}, /**Returns the time in microseconds that WiFi has been running in the given state. {@hide} */ getWifiStateTime : function( ) {}, /**Returns the number of times that WiFi has entered the given state. {@hide} */ getWifiStateCount : function( ) {}, /**Returns the time in microseconds that the wifi supplicant has been in a given state. {@hide} */ getWifiSupplStateTime : function( ) {}, /**Returns the number of times that the wifi supplicant has transitioned to a given state. {@hide} */ getWifiSupplStateCount : function( ) {}, /**Returns the time in microseconds that WIFI has been running with the given signal strength. {@hide} */ getWifiSignalStrengthTime : function( ) {}, /**Returns the number of times WIFI has entered the given signal strength. {@hide} */ getWifiSignalStrengthCount : function( ) {}, /**Returns the time in microseconds that the flashlight has been on while the device was running on battery. {@hide} */ getFlashlightOnTime : function( ) {}, /**Returns the number of times that the flashlight has been turned on while the device was running on battery. {@hide} */ getFlashlightOnCount : function( ) {}, /**Returns the time in microseconds that the camera has been on while the device was running on battery. {@hide} */ getCameraOnTime : function( ) {}, /** */ getNetworkActivityBytes : function( ) {}, /** */ getNetworkActivityPackets : function( ) {}, /**Returns true if the BatteryStats object has detailed bluetooth power reports. When true, calling {@link #getBluetoothControllerActivity(int, int)} will yield the actual power data. */ hasBluetoothActivityReporting : function( ) {}, /**For {@link #CONTROLLER_IDLE_TIME}, {@link #CONTROLLER_RX_TIME}, and {@link #CONTROLLER_TX_TIME}, returns the time spent (in milliseconds) in the respective state. For {@link #CONTROLLER_POWER_DRAIN}, returns the power used by the controller in milli-ampere-milliseconds (mAms). */ getBluetoothControllerActivity : function( ) {}, /**Returns true if the BatteryStats object has detailed WiFi power reports. When true, calling {@link #getWifiControllerActivity(int, int)} will yield the actual power data. */ hasWifiActivityReporting : function( ) {}, /**For {@link #CONTROLLER_IDLE_TIME}, {@link #CONTROLLER_RX_TIME}, and {@link #CONTROLLER_TX_TIME}, returns the time spent (in milliseconds) in the respective state. For {@link #CONTROLLER_POWER_DRAIN}, returns the power used by the controller in milli-ampere-milliseconds (mAms). */ getWifiControllerActivity : function( ) {}, /**Return the wall clock time when battery stats data collection started. */ getStartClockTime : function( ) {}, /**Return platform version tag that we were running in when the battery stats started. */ getStartPlatformVersion : function( ) {}, /**Return platform version tag that we were running in when the battery stats ended. */ getEndPlatformVersion : function( ) {}, /**Return the internal version code of the parcelled format. */ getParcelVersion : function( ) {}, /**Return whether we are currently running on battery. */ getIsOnBattery : function( ) {}, /**Returns a SparseArray containing the statistics for each uid. */ getUidStats : function( ) {}, /**Returns the current battery uptime in microseconds. @param {Number} curTime the amount of elapsed realtime in microseconds. */ getBatteryUptime : function( ) {}, /**Returns the current battery realtime in microseconds. @param {Number} curTime the amount of elapsed realtime in microseconds. */ getBatteryRealtime : function( ) {}, /**Returns the battery percentage level at the last time the device was unplugged from power, or the last time it booted on battery power. */ getDischargeStartLevel : function( ) {}, /**Returns the current battery percentage level if we are in a discharge cycle, otherwise returns the level at the last plug event. */ getDischargeCurrentLevel : function( ) {}, /**Get the amount the battery has discharged since the stats were last reset after charging, as a lower-end approximation. */ getLowDischargeAmountSinceCharge : function( ) {}, /**Get the amount the battery has discharged since the stats were last reset after charging, as an upper-end approximation. */ getHighDischargeAmountSinceCharge : function( ) {}, /**Retrieve the discharge amount over the selected discharge period <var>which</var>. */ getDischargeAmount : function( ) {}, /**Get the amount the battery has discharged while the screen was on, since the last time power was unplugged. */ getDischargeAmountScreenOn : function( ) {}, /**Get the amount the battery has discharged while the screen was on, since the last time the device was charged. */ getDischargeAmountScreenOnSinceCharge : function( ) {}, /**Get the amount the battery has discharged while the screen was off, since the last time power was unplugged. */ getDischargeAmountScreenOff : function( ) {}, /**Get the amount the battery has discharged while the screen was off, since the last time the device was charged. */ getDischargeAmountScreenOffSinceCharge : function( ) {}, /**Returns the total, last, or current battery uptime in microseconds. @param {Number} curTime the elapsed realtime in microseconds. @param {Number} which one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT. */ computeBatteryUptime : function( ) {}, /**Returns the total, last, or current battery realtime in microseconds. @param {Number} curTime the current elapsed realtime in microseconds. @param {Number} which one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT. */ computeBatteryRealtime : function( ) {}, /**Returns the total, last, or current battery screen off uptime in microseconds. @param {Number} curTime the elapsed realtime in microseconds. @param {Number} which one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT. */ computeBatteryScreenOffUptime : function( ) {}, /**Returns the total, last, or current battery screen off realtime in microseconds. @param {Number} curTime the current elapsed realtime in microseconds. @param {Number} which one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT. */ computeBatteryScreenOffRealtime : function( ) {}, /**Returns the total, last, or current uptime in microseconds. @param {Number} curTime the current elapsed realtime in microseconds. @param {Number} which one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT. */ computeUptime : function( ) {}, /**Returns the total, last, or current realtime in microseconds. @param {Number} curTime the current elapsed realtime in microseconds. @param {Number} which one of STATS_SINCE_CHARGED, STATS_SINCE_UNPLUGGED, or STATS_CURRENT. */ computeRealtime : function( ) {}, /**Compute an approximation for how much run time (in microseconds) is remaining on the battery. Returns -1 if no time can be computed: either there is not enough current data to make a decision, or the battery is currently charging. @param {Number} curTime The current elepsed realtime in microseconds. */ computeBatteryTimeRemaining : function( ) {}, /**Return the array of discharge step durations. */ getDischargeLevelStepTracker : function( ) {}, /**Return the array of daily discharge step durations. */ getDailyDischargeLevelStepTracker : function( ) {}, /**Compute an approximation for how much time (in microseconds) remains until the battery is fully charged. Returns -1 if no time can be computed: either there is not enough current data to make a decision, or the battery is currently discharging. @param {Number} curTime The current elepsed realtime in microseconds. */ computeChargeTimeRemaining : function( ) {}, /**Return the array of charge step durations. */ getChargeLevelStepTracker : function( ) {}, /**Return the array of daily charge step durations. */ getDailyChargeLevelStepTracker : function( ) {}, /** */ getDailyPackageChanges : function( ) {}, /** */ getWakeupReasonStats : function( ) {}, /** */ getKernelWakelockStats : function( ) {}, /**Returns the number of different speeds that the CPU can run at */ getCpuSpeedSteps : function( ) {}, /** */ writeToParcelWithoutUids : function( ) {}, /** */ formatTimeMs : function( ) {}, /** */ formatTimeMsNoSpace : function( ) {}, /** */ formatRatioLocked : function( ) {}, /**Temporary for settings. */ dumpCheckinLocked : function( ) {}, /**Checkin server version of dump to produce more compact, computer-readable log. NOTE: all times are expressed in 'ms'. */ dumpCheckinLocked : function( ) {}, /**Temporary for settings. */ dumpLocked : function( ) {}, /** */ dumpLocked : function( ) {}, /** */ prepareForDumpLocked : function( ) {}, /**Dumps a human-readable summary of the battery statistics to the given PrintWriter. @param {Object {Context}} pw a Printer to receive the dump output. */ dumpLocked : function( ) {}, /** */ dumpCheckinLocked : function( ) {}, };