Merge "Skip managed profile user test when the target is automotive" into rvc-dev am: 163221a3c5 am: bef7b82ae1 am: fe8d88d7d0
Change-Id: I9ff566b03382e3284476f5e17c4e78a036c6c2f5
This commit is contained in:
@@ -802,6 +802,7 @@ public final class UserManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateProfile_withContextUserId() throws Exception {
|
public void testCreateProfile_withContextUserId() throws Exception {
|
||||||
|
assumeManagedUsersSupported();
|
||||||
final int primaryUserId = mUserManager.getPrimaryUser().id;
|
final int primaryUserId = mUserManager.getPrimaryUser().id;
|
||||||
|
|
||||||
UserInfo userProfile = createProfileForUser("Managed 1",
|
UserInfo userProfile = createProfileForUser("Managed 1",
|
||||||
@@ -820,6 +821,7 @@ public final class UserManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetUserName_withContextUserId() throws Exception {
|
public void testSetUserName_withContextUserId() throws Exception {
|
||||||
|
assumeManagedUsersSupported();
|
||||||
final int primaryUserId = mUserManager.getPrimaryUser().id;
|
final int primaryUserId = mUserManager.getPrimaryUser().id;
|
||||||
|
|
||||||
UserInfo userInfo1 = createProfileForUser("Managed 1",
|
UserInfo userInfo1 = createProfileForUser("Managed 1",
|
||||||
@@ -855,6 +857,7 @@ public final class UserManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetUserIcon_withContextUserId() throws Exception {
|
public void testGetUserIcon_withContextUserId() throws Exception {
|
||||||
|
assumeManagedUsersSupported();
|
||||||
final int primaryUserId = mUserManager.getPrimaryUser().id;
|
final int primaryUserId = mUserManager.getPrimaryUser().id;
|
||||||
|
|
||||||
UserInfo userInfo1 = createProfileForUser("Managed 1",
|
UserInfo userInfo1 = createProfileForUser("Managed 1",
|
||||||
@@ -975,8 +978,11 @@ public final class UserManagerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void assumeManagedUsersSupported() {
|
private void assumeManagedUsersSupported() {
|
||||||
|
// In Automotive, if headless system user is enabled, a managed user cannot be created
|
||||||
|
// under a primary user.
|
||||||
assumeTrue("device doesn't support managed users",
|
assumeTrue("device doesn't support managed users",
|
||||||
mPackageManager.hasSystemFeature(PackageManager.FEATURE_MANAGED_USERS));
|
mPackageManager.hasSystemFeature(PackageManager.FEATURE_MANAGED_USERS)
|
||||||
|
&& (!isAutomotive() || !UserManager.isHeadlessSystemUserMode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAutomotive() {
|
private boolean isAutomotive() {
|
||||||
|
|||||||
Reference in New Issue
Block a user