Remove Limited users category if empty

If there are no users under limited category, in a secondary user,
remove the subheading completely.

Change-Id: I0397b6198c8cfc147e9e7dc30a92a7cb2f5860e3
This commit is contained in:
Amith Yamasani
2013-03-29 20:28:28 -07:00
parent a7ff2a2d22
commit 732c80ff18

View File

@@ -501,6 +501,12 @@ public class UserSettings extends SettingsPreferenceFragment
boolean moreUsers = mUserManager.getMaxSupportedUsers() > users.size();
mAddRestrictedUser.setEnabled(moreUsers);
mAddTrustedUser.setEnabled(moreUsers);
// Remove the limited users category if there aren't other limited users.
if (!mIsOwner) {
if (mLimitedUserListCategory.getPreferenceCount() == 0) {
removePreference(KEY_LIMITED_USER_LIST);
}
}
}
private void loadIconsAsync(List<Integer> missingIcons) {