Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 545e47d7 authored by Rakesh Iyer's avatar Rakesh Iyer
Browse files

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
parent e1c8372f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
+0 −4
Original line number Diff line number Diff line
@@ -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(