The PowerProfile in BatteryStatsImpl may not be ready when
resetting stats early in the boot sequence.
Bug:
29559031
Change-Id: I51bba762231a08804f1b68505bb1b0523476081d
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;