Merge "Fix a NPE in BatteryStatsImpl"

This commit is contained in:
TreeHugger Robot
2018-06-30 01:50:19 +00:00
committed by Android (Google) Code Review

View File

@@ -4034,7 +4034,9 @@ public class BatteryStatsImpl extends BatteryStats {
try {
IBatteryPropertiesRegistrar registrar = IBatteryPropertiesRegistrar.Stub.asInterface(
ServiceManager.getService("batteryproperties"));
registrar.scheduleUpdate();
if (registrar != null) {
registrar.scheduleUpdate();
}
} catch (RemoteException e) {
// Ignore.
}