Loading services/core/java/com/android/server/pm/UserTypeFactory.java +12 −1 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public final class UserTypeFactory { com.android.internal.R.color.system_neutral2_900) .setDefaultRestrictions(null) .setDefaultCrossProfileIntentFilters(getDefaultCloneCrossProfileIntentFilter()) .setDefaultSecureSettings(getDefaultNonManagedProfileSecureSettings()) .setDefaultUserProperties(new UserProperties.Builder() .setStartWithParent(true) .setShowInLauncher(UserProperties.SHOW_IN_LAUNCHER_WITH_PARENT) Loading Loading @@ -216,7 +217,8 @@ public final class UserTypeFactory { com.android.internal.R.color.profile_badge_1_dark, com.android.internal.R.color.profile_badge_2_dark, com.android.internal.R.color.profile_badge_3_dark) .setDefaultRestrictions(restrictions); .setDefaultRestrictions(restrictions) .setDefaultSecureSettings(getDefaultNonManagedProfileSecureSettings()); } /** Loading Loading @@ -337,6 +339,15 @@ public final class UserTypeFactory { return DefaultCrossProfileIntentFiltersUtils.getDefaultCloneProfileFilters(); } /** Gets a default bundle, keyed by Settings.Secure String names, for non-managed profiles. */ private static Bundle getDefaultNonManagedProfileSecureSettings() { final Bundle settings = new Bundle(); // Non-managed profiles go through neither SetupWizard nor DPC flows, so we automatically // mark them as setup. settings.putString(android.provider.Settings.Secure.USER_SETUP_COMPLETE, "1"); return settings; } /** * Reads the given xml parser to obtain device user-type customization, and updates the given * map of {@link UserTypeDetails.Builder}s accordingly. Loading services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ public final class UserManagerTest { UserHandle.of(userInfo.id)); assertThat(userContext.getSystemService( UserManager.class).isMediaSharedWithParent()).isTrue(); assertThat(Settings.Secure.getInt(userContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0)).isEqualTo(1); List<UserInfo> list = mUserManager.getUsers(); List<UserInfo> cloneUsers = list.stream().filter( Loading Loading
services/core/java/com/android/server/pm/UserTypeFactory.java +12 −1 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ public final class UserTypeFactory { com.android.internal.R.color.system_neutral2_900) .setDefaultRestrictions(null) .setDefaultCrossProfileIntentFilters(getDefaultCloneCrossProfileIntentFilter()) .setDefaultSecureSettings(getDefaultNonManagedProfileSecureSettings()) .setDefaultUserProperties(new UserProperties.Builder() .setStartWithParent(true) .setShowInLauncher(UserProperties.SHOW_IN_LAUNCHER_WITH_PARENT) Loading Loading @@ -216,7 +217,8 @@ public final class UserTypeFactory { com.android.internal.R.color.profile_badge_1_dark, com.android.internal.R.color.profile_badge_2_dark, com.android.internal.R.color.profile_badge_3_dark) .setDefaultRestrictions(restrictions); .setDefaultRestrictions(restrictions) .setDefaultSecureSettings(getDefaultNonManagedProfileSecureSettings()); } /** Loading Loading @@ -337,6 +339,15 @@ public final class UserTypeFactory { return DefaultCrossProfileIntentFiltersUtils.getDefaultCloneProfileFilters(); } /** Gets a default bundle, keyed by Settings.Secure String names, for non-managed profiles. */ private static Bundle getDefaultNonManagedProfileSecureSettings() { final Bundle settings = new Bundle(); // Non-managed profiles go through neither SetupWizard nor DPC flows, so we automatically // mark them as setup. settings.putString(android.provider.Settings.Secure.USER_SETUP_COMPLETE, "1"); return settings; } /** * Reads the given xml parser to obtain device user-type customization, and updates the given * map of {@link UserTypeDetails.Builder}s accordingly. Loading
services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ public final class UserManagerTest { UserHandle.of(userInfo.id)); assertThat(userContext.getSystemService( UserManager.class).isMediaSharedWithParent()).isTrue(); assertThat(Settings.Secure.getInt(userContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0)).isEqualTo(1); List<UserInfo> list = mUserManager.getUsers(); List<UserInfo> cloneUsers = list.stream().filter( Loading