public class BatterySipper extends Object implements Comparable<BatterySipper>
Modifier and Type | Class and Description |
---|---|
static class |
BatterySipper.DrainType |
Modifier and Type | Field and Description |
---|---|
double |
bluetoothPowerMah |
long |
bluetoothRunningTimeMs |
long |
btRxBytes |
long |
btTxBytes |
double |
cameraPowerMah |
long |
cameraTimeMs |
long |
cpuFgTimeMs |
double |
cpuPowerMah |
long |
cpuTimeMs |
BatterySipper.DrainType |
drainType |
double |
flashlightPowerMah |
long |
flashlightTimeMs |
double |
gpsPowerMah |
long |
gpsTimeMs |
long |
mobileActive |
int |
mobileActiveCount |
double |
mobilemspp |
double |
mobileRadioPowerMah |
long |
mobileRxBytes |
long |
mobileRxPackets |
long |
mobileTxBytes |
long |
mobileTxPackets |
String[] |
mPackages |
double |
noCoveragePercent |
String |
packageWithHighestDrain |
double |
percent |
double |
sensorPowerMah |
double |
totalPowerMah |
BatteryStats.Uid |
uidObj |
double |
usagePowerMah
Generic power usage in mAh.
|
long |
usageTimeMs
Generic usage time in milliseconds.
|
int |
userId |
double |
wakeLockPowerMah |
long |
wakeLockTimeMs |
double |
wifiPowerMah |
long |
wifiRunningTimeMs |
long |
wifiRxBytes |
long |
wifiRxPackets |
long |
wifiTxBytes |
long |
wifiTxPackets |
Constructor and Description |
---|
BatterySipper(BatterySipper.DrainType drainType,
BatteryStats.Uid uid,
double value) |
Modifier and Type | Method and Description |
---|---|
void |
add(BatterySipper other)
Add stats from other to this BatterySipper.
|
int |
compareTo(BatterySipper other)
Compares this object with the specified object for order.
|
void |
computeMobilemspp() |
String[] |
getPackages()
Gets a list of packages associated with the current user
|
int |
getUid() |
double |
sumPower()
Sum all the powers and store the value into `value`.
|
public int userId
public BatteryStats.Uid uidObj
public double totalPowerMah
public BatterySipper.DrainType drainType
public long usageTimeMs
public double usagePowerMah
public long cpuTimeMs
public long gpsTimeMs
public long wifiRunningTimeMs
public long cpuFgTimeMs
public long wakeLockTimeMs
public long cameraTimeMs
public long flashlightTimeMs
public long bluetoothRunningTimeMs
public long mobileRxPackets
public long mobileTxPackets
public long mobileActive
public int mobileActiveCount
public double mobilemspp
public long wifiRxPackets
public long wifiTxPackets
public long mobileRxBytes
public long mobileTxBytes
public long wifiRxBytes
public long wifiTxBytes
public long btRxBytes
public long btTxBytes
public double percent
public double noCoveragePercent
public String[] mPackages
public String packageWithHighestDrain
public double wifiPowerMah
public double cpuPowerMah
public double wakeLockPowerMah
public double mobileRadioPowerMah
public double gpsPowerMah
public double sensorPowerMah
public double cameraPowerMah
public double flashlightPowerMah
public double bluetoothPowerMah
public BatterySipper(BatterySipper.DrainType drainType, BatteryStats.Uid uid, double value)
public void computeMobilemspp()
public int compareTo(BatterySipper other)
Comparable
The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementor must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.
compareTo
in interface Comparable<BatterySipper>
other
- the object to be compared.public String[] getPackages()
public int getUid()
public void add(BatterySipper other)
public double sumPower()