OSDN Git Service

Remove the check hasMultipleUsers in Settings.
authorNicolas Prevot <nprevot@google.com>
Thu, 14 May 2015 00:19:21 +0000 (17:19 -0700)
committerNicolas Prevot <nprevot@google.com>
Thu, 14 May 2015 17:50:27 +0000 (10:50 -0700)
When deciding to show the user section or not, Just rely
on supportsMultipleUsers. Don't check hasMultipleUsers.

BUG:21119929
Change-Id: Ifbddac10e2f6dc02b8e2e55b41ab9f5be018dfca

src/com/android/settings/SettingsActivity.java
src/com/android/settings/users/UserSettings.java

index aa492f3..eb002dd 100644 (file)
@@ -1274,8 +1274,7 @@ public class SettingsActivity extends Activity
                             ((UserManager) getSystemService(Context.USER_SERVICE))
                                     .getUserCount() > 1;
                     if (!UserHandle.MU_ENABLED
-                            || (!UserManager.supportsMultipleUsers()
-                                    && !hasMultipleUsers)
+                            || !UserManager.supportsMultipleUsers()
                             || Utils.isMonkeyRunning()) {
                         removeTile = true;
                     }
index cef0833..d61032b 100644 (file)
@@ -200,7 +200,7 @@ public class UserSettings extends SettingsPreferenceFragment
         final Context context = getActivity();
         mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
         boolean hasMultipleUsers = mUserManager.getUserCount() > 1;
-        if ((!UserManager.supportsMultipleUsers() && !hasMultipleUsers)
+        if ((!UserManager.supportsMultipleUsers())
                 || Utils.isMonkeyRunning()) {
             mEnabled = false;
             return;