Fix crashloop in CarStatusBar.
System ui seems to be undergoing a refactor to bring in dependency injection, in the process, mBatteryController in CarStatusBar was not being set, causing a NPE. Since it looks like the work is still ongoing, this is just a spot fix for the crash, once the dependency injection migration is complete, we can reexamine the CarStatusBar implementation. Bug: 34633087 Test: Verified that system booted correctly. Change-Id: Idd3e0286fd87196ae572349904d5bef744d54353
This commit is contained in:
@@ -72,6 +72,7 @@ public class CarStatusBar extends PhoneStatusBar implements
|
||||
SystemServicesProxy.getInstance(mContext).registerTaskStackListener(mTaskStackListener);
|
||||
registerPackageChangeReceivers();
|
||||
|
||||
createBatteryController();
|
||||
mCarBatteryController.startListening();
|
||||
mConnectedDeviceSignalController.startListening();
|
||||
}
|
||||
@@ -113,8 +114,7 @@ public class CarStatusBar extends PhoneStatusBar implements
|
||||
return statusBarView;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BatteryController createBatteryController() {
|
||||
private BatteryController createBatteryController() {
|
||||
mCarBatteryController = new CarBatteryController(mContext);
|
||||
mCarBatteryController.addBatteryViewHandler(this);
|
||||
return mCarBatteryController;
|
||||
|
||||
@@ -989,10 +989,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
}
|
||||
|
||||
protected BatteryController createBatteryController() {
|
||||
return new BatteryControllerImpl(mContext);
|
||||
}
|
||||
|
||||
private void inflateShelf() {
|
||||
mNotificationShelf =
|
||||
(NotificationShelf) LayoutInflater.from(mContext).inflate(
|
||||
|
||||
Reference in New Issue
Block a user