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

Commit 94c7bd7e authored by Mark Kim's avatar Mark Kim Committed by Android (Google) Code Review
Browse files

Merge "Disable APP_ARCHIVING flag for specific test" into main

parents dc5c38c4 194d7f76
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -41,9 +41,11 @@ import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.os.UserHandle;
import android.os.UserManager;
import android.platform.test.flag.junit.SetFlagsRule;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher;
@@ -85,6 +87,9 @@ public final class InstalledAppCounterTest {
    @Mock
    private PackageManager mPackageManager;

    @Rule
    public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();

    private int mInstalledAppCount = -1;
    private ApplicationInfo mApp1;
    private ApplicationInfo mApp2;
@@ -218,6 +223,7 @@ public final class InstalledAppCounterTest {
                eq(MAIN_USER_ID))).thenReturn(Arrays.asList(mApp2));

        mFakeFeatureFlags.setFlag(Flags.FLAG_ARCHIVING, false);
        mSetFlagsRule.disableFlags(com.android.settings.flags.Flags.FLAG_APP_ARCHIVING);
        // Count the number of all apps installed, irrespective of install reason.
        count(InstalledAppCounter.IGNORE_INSTALL_REASON, mFakeFeatureFlags);
        assertThat(mInstalledAppCount).isEqualTo(1);