Loading core/java/android/content/pm/UserInfo.java +1 −5 Original line number Diff line number Diff line Loading @@ -446,11 +446,7 @@ public class UserInfo implements Parcelable { if (isProfile() || isGuest() || isRestricted()) { return false; } if (UserManager.isHeadlessSystemUserMode()) { return id != UserHandle.USER_SYSTEM; } else { return id == UserHandle.USER_SYSTEM; } return isMain(); } // TODO(b/142482943): Get rid of this (after removing it from all tests) if feasible. Loading services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserInfoTest.java +8 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.UserInfo.FLAG_EPHEMERAL; import static android.content.pm.UserInfo.FLAG_FULL; import static android.content.pm.UserInfo.FLAG_GUEST; import static android.content.pm.UserInfo.FLAG_INITIALIZED; import static android.content.pm.UserInfo.FLAG_MAIN; import static android.content.pm.UserInfo.FLAG_MANAGED_PROFILE; import static android.content.pm.UserInfo.FLAG_PROFILE; import static android.content.pm.UserInfo.FLAG_RESTRICTED; Loading Loading @@ -206,6 +207,13 @@ public class UserManagerServiceUserInfoTest { assertFalse("Switching to a profiles should be disabled", userInfo.supportsSwitchTo()); } /** Test UserInfo.canHaveProfile for main user */ @Test public void testCanHaveProfile() throws Exception { UserInfo userInfo = createUser(100, FLAG_MAIN, null); assertTrue("Main users can have profile", userInfo.canHaveProfile()); } /** Tests upgradeIfNecessaryLP (but without locking) for upgrading from version 8 to 9+. */ @Test public void testUpgradeIfNecessaryLP_9() { Loading Loading
core/java/android/content/pm/UserInfo.java +1 −5 Original line number Diff line number Diff line Loading @@ -446,11 +446,7 @@ public class UserInfo implements Parcelable { if (isProfile() || isGuest() || isRestricted()) { return false; } if (UserManager.isHeadlessSystemUserMode()) { return id != UserHandle.USER_SYSTEM; } else { return id == UserHandle.USER_SYSTEM; } return isMain(); } // TODO(b/142482943): Get rid of this (after removing it from all tests) if feasible. Loading
services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserInfoTest.java +8 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.UserInfo.FLAG_EPHEMERAL; import static android.content.pm.UserInfo.FLAG_FULL; import static android.content.pm.UserInfo.FLAG_GUEST; import static android.content.pm.UserInfo.FLAG_INITIALIZED; import static android.content.pm.UserInfo.FLAG_MAIN; import static android.content.pm.UserInfo.FLAG_MANAGED_PROFILE; import static android.content.pm.UserInfo.FLAG_PROFILE; import static android.content.pm.UserInfo.FLAG_RESTRICTED; Loading Loading @@ -206,6 +207,13 @@ public class UserManagerServiceUserInfoTest { assertFalse("Switching to a profiles should be disabled", userInfo.supportsSwitchTo()); } /** Test UserInfo.canHaveProfile for main user */ @Test public void testCanHaveProfile() throws Exception { UserInfo userInfo = createUser(100, FLAG_MAIN, null); assertTrue("Main users can have profile", userInfo.canHaveProfile()); } /** Tests upgradeIfNecessaryLP (but without locking) for upgrading from version 8 to 9+. */ @Test public void testUpgradeIfNecessaryLP_9() { Loading