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

Commit 324b5983 authored by Ankita Vyas's avatar Ankita Vyas
Browse files

Remove failing test

Bug: 314251399
Test: builds

Merged-In: Ied17e437c7d02ae07b8ab2e989dc7dc87ea9e589
Change-Id: I4823473d4d20ad271b1e7530cbf579ee3f1b7fef
parent b92caa92
Loading
Loading
Loading
Loading
+0 −39
Original line number Diff line number Diff line
@@ -221,45 +221,6 @@ public final class UserManagerTest {
        assertThat(mUserManager.getProfileParent(mainUserId)).isNull();
    }

    @Test
    public void testCommunalProfile() throws Exception {
        assumeTrue("Device doesn't support communal profiles ",
                mUserManager.isUserTypeEnabled(UserManager.USER_TYPE_PROFILE_COMMUNAL));

        // Create communal profile if needed
        if (mUserManager.getCommunalProfile() == null) {
            Slog.i(TAG, "Attempting to create a communal profile for a test");
            createUser("Communal", UserManager.USER_TYPE_PROFILE_COMMUNAL, /*flags*/ 0);
        }
        final UserHandle communal = mUserManager.getCommunalProfile();
        assertWithMessage("Couldn't create communal profile").that(communal).isNotNull();

        final UserTypeDetails userTypeDetails =
                UserTypeFactory.getUserTypes().get(UserManager.USER_TYPE_PROFILE_COMMUNAL);
        assertWithMessage("No communal user type on device").that(userTypeDetails).isNotNull();

        // Test that only one communal profile can be created
        final UserInfo secondCommunalProfile =
                createUser("Communal", UserManager.USER_TYPE_PROFILE_COMMUNAL, /*flags*/ 0);
        assertThat(secondCommunalProfile).isNull();

        // Verify that communal profile doesn't have a parent
        assertThat(mUserManager.getProfileParent(communal.getIdentifier())).isNull();

        // Make sure that, when switching users, the communal profile remains visible.
        final boolean isStarted = mActivityManager.startProfile(communal);
        assertWithMessage("Unable to start communal profile").that(isStarted).isTrue();
        final UserManager umCommunal = (UserManager) mContext.createPackageContextAsUser(
                        "android", 0, communal).getSystemService(Context.USER_SERVICE);
        final int originalCurrent = ActivityManager.getCurrentUser();
        final UserInfo testUser = createUser("TestUser", /* flags= */ 0);
        assertWithMessage("Communal profile not visible").that(umCommunal.isUserVisible()).isTrue();
        switchUser(testUser.id);
        assertWithMessage("Communal profile not visible").that(umCommunal.isUserVisible()).isTrue();
        switchUser(originalCurrent);
        assertWithMessage("Communal profile not visible").that(umCommunal.isUserVisible()).isTrue();
    }

    @MediumTest
    @Test
    public void testAdd2Users() throws Exception {