Show user management UI if a managed profile exists

Show UI even if flags to show multiuser UI are off, if there's a
second user on the device. This way there's an affordance to remove
the user.

Don't show the "Add user" item though.

Bug: 15447068
Change-Id: I40273005d6d8d66aed486328615acdab71d51fa4
This commit is contained in:
Amith Yamasani
2014-06-06 14:31:37 -07:00
parent b76de1d4fa
commit 4093e40e18
2 changed files with 10 additions and 3 deletions

View File

@@ -1043,8 +1043,12 @@ public class SettingsActivity extends Activity
category.removeTile(n);
}
} else if (id == R.id.user_settings) {
boolean hasMultipleUsers =
((UserManager) getSystemService(Context.USER_SERVICE))
.getUserCount() > 1;
if (!UserHandle.MU_ENABLED
|| !UserManager.supportsMultipleUsers()
|| (!UserManager.supportsMultipleUsers()
&& !hasMultipleUsers)
|| Utils.isMonkeyRunning()) {
category.removeTile(n);
}