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

Commit ecdb8b0e authored by Victor Chan's avatar Victor Chan
Browse files

Fix crash in car system ui.

Override repositionNavigationBar() in CarStatusBar
and setNavigationIconHints() in CarNavigationBarView
since they are not used  for vehicles.

Bug: 26301185
Change-Id: I1995a514301305bfd2eed64d5f43bc92a6658e15
parent 5724fe9d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -149,4 +149,11 @@ class CarNavigationBarView extends NavigationBarView {
    public View getCurrentView() {
        return this;
    }

    @Override
    public void setNavigationIconHints(int hints, boolean force) {
        // We do not need to set the navigation icon hints for a vehicle
        // Calling setNavigationIconHints in the base class will result in a NPE as the car
        // navigation bar does not have a back button.
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -57,4 +57,10 @@ public class CarStatusBar extends PhoneStatusBar {
        carNavBar.setActivityStarter(this);
        mNavigationBarView = carNavBar;
    }

    @Override
    protected void repositionNavigationBar() {
        // The navigation bar for a vehicle will not need to be repositioned, as it is always
        // set at the bottom.
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -1205,7 +1205,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        mWindowManager.addView(mNavigationBarView, getNavigationBarLayoutParams());
    }

    private void repositionNavigationBar() {
    protected void repositionNavigationBar() {
        if (mNavigationBarView == null || !mNavigationBarView.isAttachedToWindow()) return;

        prepareNavigationBarView();