Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 732c80ff authored by Amith Yamasani's avatar Amith Yamasani
Browse files

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
parent a7ff2a2d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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) {