IT. Expert System.

Android Reference

BatteryStats


android.os

Class BatteryStats

  • All Implemented Interfaces:
    Parcelable


    public abstract class BatteryStats
    extends Object
    implements Parcelable
    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.
    • Field Detail

      • WAKE_TYPE_PARTIAL

        public static final int WAKE_TYPE_PARTIAL
        A constant indicating a partial wake lock timer.
        See Also:
        Constant Field Values
      • WAKE_TYPE_FULL

        public static final int WAKE_TYPE_FULL
        A constant indicating a full wake lock timer.
        See Also:
        Constant Field Values
      • WAKE_TYPE_WINDOW

        public static final int WAKE_TYPE_WINDOW
        A constant indicating a window wake lock timer.
        See Also:
        Constant Field Values
      • SENSOR

        public static final int SENSOR
        A constant indicating a sensor timer.
        See Also:
        Constant Field Values
      • WIFI_RUNNING

        public static final int WIFI_RUNNING
        A constant indicating a a wifi running timer
        See Also:
        Constant Field Values
      • FULL_WIFI_LOCK

        public static final int FULL_WIFI_LOCK
        A constant indicating a full wifi lock timer
        See Also:
        Constant Field Values
      • WIFI_SCAN

        public static final int WIFI_SCAN
        A constant indicating a wifi scan
        See Also:
        Constant Field Values
      • WIFI_MULTICAST_ENABLED

        public static final int WIFI_MULTICAST_ENABLED
        A constant indicating a wifi multicast timer
        See Also:
        Constant Field Values
      • AUDIO_TURNED_ON

        public static final int AUDIO_TURNED_ON
        A constant indicating an audio turn on timer
        See Also:
        Constant Field Values
      • VIDEO_TURNED_ON

        public static final int VIDEO_TURNED_ON
        A constant indicating a video turn on timer
        See Also:
        Constant Field Values
      • STATS_SINCE_CHARGED

        public static final int STATS_SINCE_CHARGED
        Include all of the data in the stats, including previously saved data.
        See Also:
        Constant Field Values
      • STATS_LAST

        public static final int STATS_LAST
        Include only the last run in the stats.
        See Also:
        Constant Field Values
      • STATS_CURRENT

        public static final int STATS_CURRENT
        Include only the current run in the stats.
        See Also:
        Constant Field Values
      • STATS_SINCE_UNPLUGGED

        public static final int STATS_SINCE_UNPLUGGED
        Include only the run since the last time the device was unplugged in the stats.
        See Also:
        Constant Field Values
      • SCREEN_BRIGHTNESS_MEDIUM

        public static final int SCREEN_BRIGHTNESS_MEDIUM
        See Also:
        Constant Field Values
      • SCREEN_BRIGHTNESS_BRIGHT

        public static final int SCREEN_BRIGHTNESS_BRIGHT
        See Also:
        Constant Field Values
      • NUM_SCREEN_BRIGHTNESS_BINS

        public static final int NUM_SCREEN_BRIGHTNESS_BINS
        See Also:
        Constant Field Values
      • NUM_DATA_CONNECTION_TYPES

        public static final int NUM_DATA_CONNECTION_TYPES
        See Also:
        Constant Field Values
    • Constructor Detail

      • BatteryStats

        public BatteryStats()
    • Method Detail

      • startIteratingHistoryLocked

        public abstract boolean startIteratingHistoryLocked()
      • finishIteratingHistoryLocked

        public abstract void finishIteratingHistoryLocked()
      • startIteratingOldHistoryLocked

        public abstract boolean startIteratingOldHistoryLocked()
      • finishIteratingOldHistoryLocked

        public abstract void finishIteratingOldHistoryLocked()
      • getHistoryBaseTime

        public abstract long getHistoryBaseTime()
        Return the base time offset for the battery history.
      • getStartCount

        public abstract int getStartCount()
        Returns the number of times the device has been started.
      • getScreenOnTime

        public abstract long getScreenOnTime(long batteryRealtime,
                           int which)
        Returns the time in microseconds that the screen has been on while the device was running on battery.
      • getScreenBrightnessTime

        public abstract long getScreenBrightnessTime(int brightnessBin,
                                   long batteryRealtime,
                                   int which)
        Returns the time in microseconds that the screen has been on with the given brightness
      • getInputEventCount

        public abstract int getInputEventCount(int which)
      • getPhoneOnTime

        public abstract long getPhoneOnTime(long batteryRealtime,
                          int which)
        Returns the time in microseconds that the phone has been on while the device was running on battery.
      • getPhoneSignalStrengthTime

        public abstract long getPhoneSignalStrengthTime(int strengthBin,
                                      long batteryRealtime,
                                      int which)
        Returns the time in microseconds that the phone has been running with the given signal strength.
      • getPhoneSignalScanningTime

        public abstract long getPhoneSignalScanningTime(long batteryRealtime,
                                      int which)
        Returns the time in microseconds that the phone has been trying to acquire a signal.
      • getPhoneSignalStrengthCount

        public abstract int getPhoneSignalStrengthCount(int strengthBin,
                                      int which)
        Returns the number of times the phone has entered the given signal strength.
      • getPhoneDataConnectionTime

        public abstract long getPhoneDataConnectionTime(int dataType,
                                      long batteryRealtime,
                                      int which)
        Returns the time in microseconds that the phone has been running with the given data connection.
      • getPhoneDataConnectionCount

        public abstract int getPhoneDataConnectionCount(int dataType,
                                      int which)
        Returns the number of times the phone has entered the given data connection type.
      • getWifiOnTime

        public abstract long getWifiOnTime(long batteryRealtime,
                         int which)
        Returns the time in microseconds that wifi has been on while the device was running on battery.
      • getGlobalWifiRunningTime

        public abstract long getGlobalWifiRunningTime(long batteryRealtime,
                                    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.
      • getBluetoothOnTime

        public abstract long getBluetoothOnTime(long batteryRealtime,
                              int which)
        Returns the time in microseconds that bluetooth has been on while the device was running on battery.
      • getIsOnBattery

        public abstract boolean getIsOnBattery()
        Return whether we are currently running on battery.
      • getUidStats

        public abstract SparseArray<? extends BatteryStats.Uid> getUidStats()
        Returns a SparseArray containing the statistics for each uid.
      • getBatteryUptime

        public abstract long getBatteryUptime(long curTime)
        Returns the current battery uptime in microseconds.
        Parameters:
        curTime - the amount of elapsed realtime in microseconds.
      • getRadioDataUptimeMs

        public long getRadioDataUptimeMs()
        Deprecated. use getRadioDataUptime
      • getRadioDataUptime

        public abstract long getRadioDataUptime()
        Returns the time that the radio was on for data transfers.
        Returns:
        the uptime in microseconds while unplugged
      • getBatteryRealtime

        public abstract long getBatteryRealtime(long curTime)
        Returns the current battery realtime in microseconds.
        Parameters:
        curTime - the amount of elapsed realtime in microseconds.
      • getDischargeStartLevel

        public abstract 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.
      • getDischargeCurrentLevel

        public abstract int getDischargeCurrentLevel()
        Returns the current battery percentage level if we are in a discharge cycle, otherwise returns the level at the last plug event.
      • getLowDischargeAmountSinceCharge

        public abstract int getLowDischargeAmountSinceCharge()
        Get the amount the battery has discharged since the stats were last reset after charging, as a lower-end approximation.
      • getHighDischargeAmountSinceCharge

        public abstract int getHighDischargeAmountSinceCharge()
        Get the amount the battery has discharged since the stats were last reset after charging, as an upper-end approximation.
      • getDischargeAmountScreenOn

        public abstract int getDischargeAmountScreenOn()
        Get the amount the battery has discharged while the screen was on, since the last time power was unplugged.
      • getDischargeAmountScreenOnSinceCharge

        public abstract int getDischargeAmountScreenOnSinceCharge()
        Get the amount the battery has discharged while the screen was on, since the last time the device was charged.
      • getDischargeAmountScreenOff

        public abstract int getDischargeAmountScreenOff()
        Get the amount the battery has discharged while the screen was off, since the last time power was unplugged.
      • getDischargeAmountScreenOffSinceCharge

        public abstract int getDischargeAmountScreenOffSinceCharge()
        Get the amount the battery has discharged while the screen was off, since the last time the device was charged.
      • computeBatteryUptime

        public abstract long computeBatteryUptime(long curTime,
                                int which)
        Returns the total, last, or current battery uptime in microseconds.
        Parameters:
        curTime - the elapsed realtime in microseconds.
        which - one of STATS_TOTAL, STATS_LAST, or STATS_CURRENT.
      • computeBatteryRealtime

        public abstract long computeBatteryRealtime(long curTime,
                                  int which)
        Returns the total, last, or current battery realtime in microseconds.
        Parameters:
        curTime - the current elapsed realtime in microseconds.
        which - one of STATS_TOTAL, STATS_LAST, or STATS_CURRENT.
      • computeUptime

        public abstract long computeUptime(long curTime,
                         int which)
        Returns the total, last, or current uptime in microseconds.
        Parameters:
        curTime - the current elapsed realtime in microseconds.
        which - one of STATS_TOTAL, STATS_LAST, or STATS_CURRENT.
      • computeRealtime

        public abstract long computeRealtime(long curTime,
                           int which)
        Returns the total, last, or current realtime in microseconds. *
        Parameters:
        curTime - the current elapsed realtime in microseconds.
        which - one of STATS_TOTAL, STATS_LAST, or STATS_CURRENT.
      • getCpuSpeedSteps

        public abstract int getCpuSpeedSteps()
        Returns the number of different speeds that the CPU can run at
      • dumpCheckinLocked

        public final void dumpCheckinLocked(PrintWriter pw,
                             int which,
                             int reqUid)
        Checkin server version of dump to produce more compact, computer-readable log. NOTE: all times are expressed in 'ms'.
      • dumpLocked

        public final void dumpLocked(PrintWriter pw,
                      String prefix,
                      int which,
                      int reqUid)
      • prepareForDumpLocked

        public void prepareForDumpLocked()
      • dumpLocked

        public void dumpLocked(PrintWriter pw)
        Dumps a human-readable summary of the battery statistics to the given PrintWriter.
        Parameters:
        pw - a Printer to receive the dump output.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 899 / 158859947. Delta: 0.04110 с