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

Commit b9be8d82 authored by Adam Bookatz's avatar Adam Bookatz Committed by Android (Google) Code Review
Browse files

Merge "UserTypeFactory configurable setMaxAllowed"

parents ba16af78 4db1b9c1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ Supported optional properties (to be used as shown in the example above) are as
For profile and full users:
    default-restrictions (with values defined in UserRestrictionUtils.USER_RESTRICTIONS)
    enabled
    user-properties
    max-allowed
For profile users only:
    max-allowed-per-parent
    icon-badge
+1 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ public final class UserTypeFactory {
                }

                setIntAttribute(parser, "enabled", builder::setEnabled);
                setIntAttribute(parser, "max-allowed", builder::setMaxAllowed);

                // Process child elements.
                final int depth = parser.getDepth();
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@
<user-types>
    <full-type
        name='android.test.1'
        max-allowed-per-parent='12' >
        max-allowed-per-parent='12'
        max-allowed='17' >
        <default-restrictions no_remove_user='true' no_bluetooth='true' />
        <badge-colors>
            <item res='@*android:color/profile_badge_1' />
+1 −0
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ public class UserManagerServiceUserTypeTest {
        UserTypeDetails details = builders.get(userTypeFull).createUserTypeDetails();
        assertEquals(UNLIMITED_NUMBER_OF_USERS, details.getMaxAllowedPerParent());
        assertFalse(details.isEnabled());
        assertEquals(17, details.getMaxAllowed());
        assertTrue(UserRestrictionsUtils.areEqual(
                makeRestrictionsBundle("no_remove_user", "no_bluetooth"),
                details.getDefaultRestrictions()));