Hide MultiUserSwitch when guestEnabled && no_add_users

If the device is guestEnabled but the user cannot add new users (either
by system or by device policy), do not show MultiUserSwitch

Even if the user set the setting USER_SWITCHER_ENABLED to true by
accidentally going to "Multiple Users", it doesn't make sense to show it
in devices with a single user that cannot add users.

We still set the setting to true by default (even if it may be disabled
by policy), as the setting should reflect what the user sees in that
screen.

Test: manual
   * Set the user restrictions for user 0 as per in BR in b/134569467.
   Including policy as well as modifying /data/system/users/0.xml
   * Go to Multiple Users, see that it matches screenshot with setting
   enabled
   * See that the issue is that guests are enabled, even though the user
   cannot add guests and that's why MultiUserSwitch is showing.

Fixes: 134569467
Change-Id: If7c596769faa577d6d9ba8943722fb6e6734f7c2
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
index 443cc43..c0a1b12 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
@@ -112,7 +112,9 @@
 
         final boolean guestEnabled = !mContext.getSystemService(DevicePolicyManager.class)
                 .getGuestUserDisabled(null);
-        return mUserSwitcherController.getSwitchableUserCount() > 1 || guestEnabled
+        return mUserSwitcherController.getSwitchableUserCount() > 1
+                // If we cannot add guests even if they are enabled, do not show
+                || (guestEnabled && !mUserManager.hasUserRestriction(UserManager.DISALLOW_ADD_USER))
                 || mContext.getResources().getBoolean(R.bool.qs_show_user_switcher_for_single_user);
     }