Merge "Fix JAVA_CRASH NullPointerException in BatteryUsageDataLoader." into udc-qpr-dev
diff --git a/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java b/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java
index cc0067b..55ef937 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java
@@ -120,7 +120,7 @@
DatabaseUtils.sendBatteryUsageSlotData(context,
ConvertUtils.convertToBatteryUsageSlotList(batteryDiffDataMap));
if (batteryDiffDataMap.values().stream().anyMatch(data ->
- (!data.getAppDiffEntryList().isEmpty()
+ data != null && (!data.getAppDiffEntryList().isEmpty()
|| !data.getSystemDiffEntryList().isEmpty()))) {
FeatureFactory.getFactory(context).getPowerUsageFeatureProvider(context)
.detectSettingsAnomaly(context, /* displayDrain= */ 0);