Update BatteryInfo to include averageTimeToDischarge
This updates the Estimate data model class as well as the places it is used to populate the new field when available. Test: robotests Bug: 74020365 Change-Id: Ibcecf933819f8b8cd8514205768569e9bd7d1517 (cherry picked from commit453db0cdbc
) Merged-In:453db0cdbc
This commit is contained in:
@@ -438,14 +438,15 @@ public class BatteryUtils {
|
||||
|
||||
if (estimate != null) {
|
||||
batteryInfo = BatteryInfo.getBatteryInfo(mContext, batteryBroadcast, stats,
|
||||
elapsedRealtimeUs, false /* shortString */,
|
||||
PowerUtil.convertMsToUs(estimate.estimateMillis),
|
||||
estimate.isBasedOnUsage);
|
||||
estimate, elapsedRealtimeUs, false /* shortString */);
|
||||
} else {
|
||||
estimate = new Estimate(
|
||||
PowerUtil.convertUsToMs(stats.computeBatteryTimeRemaining(elapsedRealtimeUs)),
|
||||
false,
|
||||
Estimate.AVERAGE_TIME_TO_DISCHARGE_UNKNOWN
|
||||
);
|
||||
batteryInfo = BatteryInfo.getBatteryInfo(mContext, batteryBroadcast, stats,
|
||||
elapsedRealtimeUs, false /* shortString */,
|
||||
discharging ? stats.computeBatteryTimeRemaining(elapsedRealtimeUs) : 0,
|
||||
false /* basedOnUsage */);
|
||||
estimate, elapsedRealtimeUs, false /* shortString */);
|
||||
}
|
||||
BatteryUtils.logRuntime(tag, "BatteryInfoLoader.loadInBackground", startTime);
|
||||
|
||||
|
Reference in New Issue
Block a user