Merge "Add NullPtrCheck when smearing in settings" into pi-dev am: c2ec26b4ac

am: f26e2fda76

Change-Id: I71949412d9b4cf5890833a03a00cd903d0fc5784
This commit is contained in:
Lei Yu
2018-04-09 10:42:25 -07:00
committed by android-build-merger
2 changed files with 17 additions and 0 deletions

View File

@@ -214,6 +214,11 @@ public class BatteryUtils {
}
if (totalActivityTimeMs >= 10 * DateUtils.MINUTE_IN_MILLIS) {
if (screenSipper == null) {
Log.e(TAG, "screen sipper is null even when app screen time is not zero");
return;
}
final double screenPowerMah = screenSipper.totalPowerMah;
for (int i = 0, size = sippers.size(); i < size; i++) {
final BatterySipper sipper = sippers.get(i);