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
This commit is contained in:
Salvador Martinez
2018-03-02 17:09:48 -08:00
parent 22a39c2b93
commit 453db0cdbc
5 changed files with 79 additions and 57 deletions

View File

@@ -58,12 +58,10 @@ public class DebugEstimatesLoader extends AsyncLoader<List<BatteryInfo>> {
Estimate estimate = powerUsageFeatureProvider.getEnhancedBatteryPrediction(context);
if (estimate == null) {
estimate = new Estimate(0, false);
estimate = new Estimate(0, false, Estimate.AVERAGE_TIME_TO_DISCHARGE_UNKNOWN);
}
BatteryInfo newInfo = BatteryInfo.getBatteryInfo(getContext(), batteryBroadcast, stats,
elapsedRealtimeUs, false,
PowerUtil.convertMsToUs(estimate.estimateMillis),
estimate.isBasedOnUsage);
estimate, elapsedRealtimeUs, false);
List<BatteryInfo> infos = new ArrayList<>();
infos.add(oldinfo);