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

Commit 09295a22 authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Ensure we update the navigation mode when switching users" into rvc-dev...

Merge "Ensure we update the navigation mode when switching users" into rvc-dev am: 2e0fd15e am: de237eab

Change-Id: I6f67a7d66c2978e6d75c5c92ba06a44ccafcddec
parents 14e119d6 de237eab
Loading
Loading
Loading
Loading
+23 −4
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.util.Log;
import com.android.systemui.Dumpable;
import com.android.systemui.dagger.qualifiers.UiBackground;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -78,13 +79,31 @@ public class NavigationModeController implements Dumpable {
        }
    };

    private final DeviceProvisionedController.DeviceProvisionedListener mDeviceProvisionedCallback =
            new DeviceProvisionedController.DeviceProvisionedListener() {
                @Override
                public void onUserSwitched() {
                    if (DEBUG) {
                        Log.d(TAG, "onUserSwitched: "
                                + ActivityManagerWrapper.getInstance().getCurrentUserId());
                    }

                    // Update the nav mode for the current user
                    updateCurrentInteractionMode(true /* notify */);
                }
            };


    @Inject
    public NavigationModeController(Context context, @UiBackground Executor uiBgExecutor) {
    public NavigationModeController(Context context,
            DeviceProvisionedController deviceProvisionedController,
            @UiBackground Executor uiBgExecutor) {
        mContext = context;
        mCurrentUserContext = context;
        mOverlayManager = IOverlayManager.Stub.asInterface(
                ServiceManager.getService(Context.OVERLAY_SERVICE));
        mUiBgExecutor = uiBgExecutor;
        deviceProvisionedController.addCallback(mDeviceProvisionedCallback);

        IntentFilter overlayFilter = new IntentFilter(ACTION_OVERLAY_CHANGED);
        overlayFilter.addDataScheme("package");