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

Commit 5a25020d authored by Matthew Ng's avatar Matthew Ng
Browse files

Prevent nav mode from being -1 to avoid crash

Computing the nav mode would return -1 if there were no difference in
sys ui new and old bar mode. When dumping the data from nav bar, it
would crash if bar mode was -1 and there is no static constant for -1
bar mode. Therefore prevent setting -1 as a valid bar mode.

Test: manual
Change-Id: I9747f7aa7273b4bc05d26b08130818f059645187
Fixes: 117324620
parent 72555cca
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -641,9 +641,12 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
    // Injected from StatusBar at creation.
    public void setCurrentSysuiVisibility(int systemUiVisibility) {
        mSystemUiVisibility = systemUiVisibility;
        mNavigationBarMode = mStatusBar.computeBarMode(0, mSystemUiVisibility,
        final int barMode = mStatusBar.computeBarMode(0, mSystemUiVisibility,
                View.NAVIGATION_BAR_TRANSIENT, View.NAVIGATION_BAR_TRANSLUCENT,
                View.NAVIGATION_BAR_TRANSPARENT);
        if (barMode != -1) {
            mNavigationBarMode = barMode;
        }
        checkNavBarModes();
        mStatusBar.touchAutoHide();
        mLightBarController.onNavigationVisibilityChanged(mSystemUiVisibility, 0 /* mask */,