Merge "Fix crash in BatteryUtils"
This commit is contained in:
committed by
Android (Google) Code Review
commit
0ade53c9b5
@@ -449,12 +449,14 @@ public class BatteryUtils {
|
||||
final BatteryStats stats = statsHelper.getStats();
|
||||
BatteryInfo batteryInfo;
|
||||
|
||||
final Estimate estimate;
|
||||
Estimate estimate = null;
|
||||
// Get enhanced prediction if available
|
||||
if (mPowerUsageFeatureProvider != null &&
|
||||
mPowerUsageFeatureProvider.isEnhancedBatteryPredictionEnabled(mContext)) {
|
||||
estimate = mPowerUsageFeatureProvider.getEnhancedBatteryPrediction(mContext);
|
||||
} else {
|
||||
}
|
||||
|
||||
if (estimate == null) {
|
||||
estimate = new Estimate(
|
||||
PowerUtil.convertUsToMs(stats.computeBatteryTimeRemaining(elapsedRealtimeUs)),
|
||||
false /* isBasedOnUsage */,
|
||||
|
Reference in New Issue
Block a user