diff --git a/src/com/android/settings/users/MultiUserSwitchBarController.java b/src/com/android/settings/users/MultiUserSwitchBarController.java
index 9588f71..58de149 100644
--- a/src/com/android/settings/users/MultiUserSwitchBarController.java
+++ b/src/com/android/settings/users/MultiUserSwitchBarController.java
@@ -17,27 +17,34 @@
 package com.android.settings.users;
 
 import android.content.Context;
+import android.os.UserHandle;
+import android.os.UserManager;
 import android.provider.Settings;
 import android.util.Log;
 
+import androidx.annotation.VisibleForTesting;
+
 import com.android.settings.widget.SwitchWidgetController;
+import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.core.lifecycle.events.OnStop;
 
 public class MultiUserSwitchBarController implements SwitchWidgetController.OnSwitchChangeListener,
         LifecycleObserver, OnStart, OnStop {
+    private static final String TAG = "MultiUserSwitchBarCtrl";
 
     interface OnMultiUserSwitchChangedListener {
         void onMultiUserSwitchChanged(boolean newState);
     }
+    @VisibleForTesting
+    final SwitchWidgetController mSwitchBar;
 
-    private static final String TAG = "MultiUserSwitchBarCtrl";
     private final Context mContext;
-    private final SwitchWidgetController mSwitchBar;
     private final UserCapabilities mUserCapabilities;
     private final OnMultiUserSwitchChangedListener mListener;
 
+
     MultiUserSwitchBarController(Context context, SwitchWidgetController switchBar,
             OnMultiUserSwitchChangedListener listener) {
         mContext = context;
@@ -45,8 +52,15 @@
         mListener = listener;
         mUserCapabilities = UserCapabilities.create(context);
         mSwitchBar.setChecked(mUserCapabilities.mUserSwitcherEnabled);
-        mSwitchBar.setEnabled(!mUserCapabilities.mDisallowSwitchUser
-                && !mUserCapabilities.mIsGuest && mUserCapabilities.isAdmin());
+
+        if (mUserCapabilities.mDisallowSwitchUser) {
+            mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal
+                    .checkIfRestrictionEnforced(mContext, UserManager.DISALLOW_USER_SWITCH,
+                            UserHandle.myUserId()));
+        } else {
+            mSwitchBar.setEnabled(!mUserCapabilities.mDisallowSwitchUser
+                    && !mUserCapabilities.mIsGuest && mUserCapabilities.isAdmin());
+        }
         mSwitchBar.setListener(this);
     }
 
diff --git a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowUserManager.java b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowUserManager.java
index 9a18c1f..bceba3c 100644
--- a/tests/robotests/src/com/android/settings/testutils/shadow/ShadowUserManager.java
+++ b/tests/robotests/src/com/android/settings/testutils/shadow/ShadowUserManager.java
@@ -26,6 +26,7 @@
 import org.robolectric.annotation.Implementation;
 import org.robolectric.annotation.Implements;
 import org.robolectric.shadow.api.Shadow;
+import org.robolectric.annotation.Resetter;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -38,6 +39,8 @@
 @Implements(value = UserManager.class)
 public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager {
 
+    private static boolean sIsSupportsMultipleUsers;
+
     private final List<String> mRestrictions = new ArrayList<>();
     private final Map<String, List<EnforcingUser>> mRestrictionSources = new HashMap<>();
     private final List<UserInfo> mUserProfileInfos = new ArrayList<>();
@@ -50,6 +53,11 @@
         mUserProfileInfos.add(userInfo);
     }
 
+    @Resetter
+    public static void reset() {
+        sIsSupportsMultipleUsers = false;
+    }
+
     @Implementation
     protected List<UserInfo> getProfiles(@UserIdInt int userHandle) {
         return mUserProfileInfos;
@@ -124,4 +132,13 @@
     public void setUserSwitcherEnabled(boolean userSwitchEnabled) {
         mUserSwitchEnabled = userSwitchEnabled;
     }
+
+    @Implementation
+    protected static boolean supportsMultipleUsers() {
+        return sIsSupportsMultipleUsers;
+    }
+
+    public void setSupportsMultipleUsers(boolean supports) {
+        sIsSupportsMultipleUsers = supports;
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/users/MultiUserSwitchBarControllerTest.java b/tests/robotests/src/com/android/settings/users/MultiUserSwitchBarControllerTest.java
new file mode 100644
index 0000000..718e01b
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/users/MultiUserSwitchBarControllerTest.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.users;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+
+import android.content.Context;
+import android.os.UserHandle;
+import android.os.UserManager;
+
+import com.android.settings.testutils.shadow.ShadowUserManager;
+import com.android.settings.widget.SwitchBar;
+import com.android.settings.widget.SwitchBarController;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+@RunWith(RobolectricTestRunner.class)
+@Config(shadows = {ShadowUserManager.class})
+public class MultiUserSwitchBarControllerTest {
+
+    private Context mContext;
+    private ShadowUserManager mUserManager;
+    private SwitchBarController mSwitchBarController;
+
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+        mUserManager = ShadowUserManager.getShadow();
+        mSwitchBarController = spy(new SwitchBarController(new SwitchBar(mContext)));
+        mUserManager.setSupportsMultipleUsers(true);
+    }
+
+    @After
+    public void tearDown() {
+        ShadowUserManager.reset();
+    }
+
+    @Test
+    public void onStart_disallowUserSwitch_shouldSetDisabledByAdmin() {
+        mUserManager.setUserRestriction(UserHandle.of(UserHandle.myUserId()),
+                UserManager.DISALLOW_USER_SWITCH, true);
+
+        final MultiUserSwitchBarController controller = new MultiUserSwitchBarController(mContext,
+                mSwitchBarController, null);
+
+        verify(mSwitchBarController).setDisabledByAdmin(any());
+    }
+
+    @Test
+    public void onStart_allowUserSwitch_shouldNotSetDisabledByAdmin() {
+        mUserManager.setUserRestriction(UserHandle.of(UserHandle.myUserId()),
+                UserManager.DISALLOW_USER_SWITCH, false);
+
+        final MultiUserSwitchBarController controller = new MultiUserSwitchBarController(mContext,
+                mSwitchBarController, null);
+
+        verify(mSwitchBarController, never()).setDisabledByAdmin(any());
+    }
+}
