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

Commit 87f70dbf authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Do not reinflate navbar on theme changes" into sc-dev

parents 69a0c089 a065cf4d
Loading
Loading
Loading
Loading
+13 −13
Original line number Original line Diff line number Diff line
@@ -25,7 +25,6 @@ import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.UserHandle;
import android.util.Log;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseArray;
import android.view.Display;
import android.view.Display;
@@ -54,7 +53,6 @@ import com.android.systemui.model.SysUiState;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.recents.OverviewProxyService;
import com.android.systemui.recents.OverviewProxyService;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.Recents;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.CommandQueue.Callbacks;
import com.android.systemui.statusbar.CommandQueue.Callbacks;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
@@ -116,7 +114,7 @@ public class NavigationBarController implements Callbacks,
    // Tracks config changes that will actually recreate the nav bar
    // Tracks config changes that will actually recreate the nav bar
    private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges(
    private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges(
            ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_LOCALE
            ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_LOCALE
                    | ActivityInfo.CONFIG_SCREEN_LAYOUT | ActivityInfo.CONFIG_ASSETS_PATHS
                    | ActivityInfo.CONFIG_SCREEN_LAYOUT
                    | ActivityInfo.CONFIG_UI_MODE);
                    | ActivityInfo.CONFIG_UI_MODE);


    @Inject
    @Inject
@@ -171,6 +169,7 @@ public class NavigationBarController implements Callbacks,
        configurationController.addCallback(this);
        configurationController.addCallback(this);
        mConfigChanges.applyNewConfig(mContext.getResources());
        mConfigChanges.applyNewConfig(mContext.getResources());
        mNavBarOverlayController = navBarOverlayController;
        mNavBarOverlayController = navBarOverlayController;
        mNavigationModeController.addListener(this);
    }
    }


    @Override
    @Override
@@ -188,18 +187,19 @@ public class NavigationBarController implements Callbacks,


    @Override
    @Override
    public void onNavigationModeChanged(int mode) {
    public void onNavigationModeChanged(int mode) {
        // Workaround for b/132825155, for secondary users, we currently don't receive configuration
        // changes on overlay package change since SystemUI runs for the system user. In this case,
        // trigger a new configuration change to ensure that the nav bar is updated in the same way.
        int userId = ActivityManagerWrapper.getInstance().getCurrentUserId();
        if (userId != UserHandle.USER_SYSTEM) {
        mHandler.post(() -> {
        mHandler.post(() -> {
            for (int i = 0; i < mNavigationBars.size(); i++) {
            for (int i = 0; i < mNavigationBars.size(); i++) {
                    recreateNavigationBar(mNavigationBars.keyAt(i));
                NavigationBar navBar = mNavigationBars.valueAt(i);
                if (navBar == null) {
                    continue;
                }
                }
            });
                NavigationBarView view = (NavigationBarView) mNavigationBars.get(i).getView();
                if (view != null) {
                    view.updateStates();
                }
                }
            }
            }
        });
    }


    @Override
    @Override
    public void onDisplayRemoved(int displayId) {
    public void onDisplayRemoved(int displayId) {