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

Commit 6226ed35 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

SystemUI: Fix navigation bar recreation when applying theme

JB window policy forbids attaching more than one view of
type NAVIGATION_BAR without recreating the entire window.

So instead of detach/recreate/attach the view when applying a theme,
simply avoid touching it during the process, and reposition it
once the reinflated bar is back in place.

Change-Id: I79e9f7da6852c1892f859271ad57561884edc7d2
parent ade0e68c
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ public class PhoneStatusBar extends BaseStatusBar {
        try {
            boolean showNav = mWindowManager.hasNavigationBar();
            if (DEBUG) Slog.v(TAG, "hasNavigationBar=" + showNav);
            if (showNav) {
            if (showNav && !mRecreating) {
                mNavigationBarView =
                    (NavigationBarView) View.inflate(context, R.layout.navigation_bar, null);

@@ -2463,11 +2463,8 @@ public class PhoneStatusBar extends BaseStatusBar {
        copyNotifications(notifications, mNotificationData);
        mNotificationData.clear();

        if (mNavigationBarView != null) {
            WindowManagerImpl.getDefault().removeView(mNavigationBarView);
        }
        makeStatusBarView();
        addNavigationBar();
        repositionNavigationBar();

        // recreate StatusBarIconViews.
        for (int i = 0; i < nIcons; i++) {