Merge "Convert BatteryStats.dumpLocked from BatteryStatsHelper to BatteryUsageStats" into sc-dev am: 7b32d78264
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14207705 Change-Id: I8c67f52f8a94c3ac6ed62e3383824baaaba33d05
This commit is contained in:
@@ -42,6 +42,8 @@ public class BatteryChargeCalculator extends PowerCalculator {
|
||||
batteryCapacityMah = batteryStats.getEstimatedBatteryCapacity();
|
||||
}
|
||||
}
|
||||
builder.setBatteryCapacity(batteryCapacityMah);
|
||||
|
||||
final double dischargedPowerLowerBoundMah =
|
||||
batteryStats.getLowDischargeAmountSinceCharge() * batteryCapacityMah / 100.0;
|
||||
final double dischargedPowerUpperBoundMah =
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.os.UidBatteryConsumer;
|
||||
import android.os.UserHandle;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -157,6 +158,12 @@ public abstract class PowerCalculator {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints formatted amount of power in milli-amp-hours.
|
||||
*/
|
||||
public static void printPowerMah(PrintWriter pw, double powerMah) {
|
||||
pw.print(formatCharge(powerMah));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts charge in mAh to string.
|
||||
|
||||
Reference in New Issue
Block a user