public final class BatteryStatsHelper extends Object
Constructor and Description |
---|
BatteryStatsHelper(Context context) |
BatteryStatsHelper(Context context,
boolean collectBatteryBroadcast) |
BatteryStatsHelper(Context context,
boolean collectBatteryBroadcast,
boolean wifiOnly) |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkHasBluetoothPowerReporting(BatteryStats stats,
PowerProfile profile) |
static boolean |
checkHasWifiPowerReporting(BatteryStats stats,
PowerProfile profile) |
static boolean |
checkWifiOnly(Context context) |
void |
clearStats()
Clears the current stats and forces recreating for future use.
|
void |
create(BatteryStats stats) |
void |
create(Bundle icicle) |
static void |
dropFile(Context context,
String fname) |
Intent |
getBatteryBroadcast() |
double |
getComputedPower() |
double |
getMaxDrainedPower() |
double |
getMaxPower() |
double |
getMaxRealPower() |
double |
getMinDrainedPower() |
List<BatterySipper> |
getMobilemsppList() |
PowerProfile |
getPowerProfile() |
BatteryStats |
getStats() |
long |
getStatsPeriod() |
int |
getStatsType() |
double |
getTotalPower() |
List<BatterySipper> |
getUsageList() |
static String |
makemAh(double power) |
static byte[] |
readFully(FileInputStream stream) |
static byte[] |
readFully(FileInputStream stream,
int avail) |
void |
refreshStats(int statsType,
int asUser)
Refreshes the power usage list.
|
void |
refreshStats(int statsType,
List<UserHandle> asUsers)
Refreshes the power usage list.
|
void |
refreshStats(int statsType,
SparseArray<UserHandle> asUsers)
Refreshes the power usage list.
|
void |
refreshStats(int statsType,
SparseArray<UserHandle> asUsers,
long rawRealtimeUs,
long rawUptimeUs) |
static BatteryStats |
statsFromFile(Context context,
String fname) |
void |
storeState() |
void |
storeStatsHistoryInFile(String fname) |
public BatteryStatsHelper(Context context)
public BatteryStatsHelper(Context context, boolean collectBatteryBroadcast)
public BatteryStatsHelper(Context context, boolean collectBatteryBroadcast, boolean wifiOnly)
public static boolean checkWifiOnly(Context context)
public static boolean checkHasWifiPowerReporting(BatteryStats stats, PowerProfile profile)
public static boolean checkHasBluetoothPowerReporting(BatteryStats stats, PowerProfile profile)
public void storeStatsHistoryInFile(String fname)
public static BatteryStats statsFromFile(Context context, String fname)
public void clearStats()
public BatteryStats getStats()
public Intent getBatteryBroadcast()
public PowerProfile getPowerProfile()
public void create(BatteryStats stats)
public void create(Bundle icicle)
public void storeState()
public static String makemAh(double power)
public void refreshStats(int statsType, int asUser)
public void refreshStats(int statsType, List<UserHandle> asUsers)
public void refreshStats(int statsType, SparseArray<UserHandle> asUsers)
public void refreshStats(int statsType, SparseArray<UserHandle> asUsers, long rawRealtimeUs, long rawUptimeUs)
public List<BatterySipper> getUsageList()
public List<BatterySipper> getMobilemsppList()
public long getStatsPeriod()
public int getStatsType()
public double getMaxPower()
public double getMaxRealPower()
public double getTotalPower()
public double getComputedPower()
public double getMinDrainedPower()
public double getMaxDrainedPower()
public static byte[] readFully(FileInputStream stream) throws IOException
IOException
public static byte[] readFully(FileInputStream stream, int avail) throws IOException
IOException