Prevent early boot crash reading PowerProfile
The PowerProfile in BatteryStatsImpl may not be ready when resetting stats early in the boot sequence. Bug:29559031 Change-Id: I51bba762231a08804f1b68505bb1b0523476081d
This commit is contained in:
@@ -8186,7 +8186,12 @@ public class BatteryStatsImpl extends BatteryStats {
|
||||
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
|
||||
mScreenBrightnessTimer[i].reset(false);
|
||||
}
|
||||
mEstimatedBatteryCapacity = (int) mPowerProfile.getBatteryCapacity();
|
||||
|
||||
if (mPowerProfile != null) {
|
||||
mEstimatedBatteryCapacity = (int) mPowerProfile.getBatteryCapacity();
|
||||
} else {
|
||||
mEstimatedBatteryCapacity = -1;
|
||||
}
|
||||
mInteractiveTimer.reset(false);
|
||||
mPowerSaveModeEnabledTimer.reset(false);
|
||||
mLastIdleTimeStart = elapsedRealtimeMillis;
|
||||
|
||||
Reference in New Issue
Block a user