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

Commit c9a0b87f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[PreferencesHelperTest] Ensure promoted value NOT depend on default value" into main

parents c695b9cf 86814543
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ public class PreferencesHelperTest extends UiServiceTestCase {
    public static List<FlagsParameterization> getParams() {
        return FlagsParameterization.allCombinationsOf(
                android.app.Flags.FLAG_API_RICH_ONGOING,
                android.app.Flags.FLAG_UI_RICH_ONGOING,
                FLAG_NOTIFICATION_CLASSIFICATION, FLAG_NOTIFICATION_CLASSIFICATION_UI,
                FLAG_MODES_UI, android.app.Flags.FLAG_NM_BINDER_PERF_CACHE_CHANNELS);
    }
@@ -662,6 +663,7 @@ public class PreferencesHelperTest extends UiServiceTestCase {

        mHelper.setShowBadge(PKG_N_MR1, UID_N_MR1, true);
        if (android.app.Flags.uiRichOngoing()) {
            mHelper.setCanBePromoted(PKG_N_MR1, UID_N_MR1, false, true);
            mHelper.setCanBePromoted(PKG_N_MR1, UID_N_MR1, true, true);
        }

@@ -6643,6 +6645,8 @@ public class PreferencesHelperTest extends UiServiceTestCase {
    @Test
    @EnableFlags(android.app.Flags.FLAG_API_RICH_ONGOING)
    public void testSetCanBePromoted_allowlistNotOverrideUser() {
        // default value is true. So we need to set it false to trigger the change.
        mHelper.setCanBePromoted(PKG_P, UID_P, false, true);
        mHelper.setCanBePromoted(PKG_P, UID_P, true, true);
        assertThat(mHelper.canBePromoted(PKG_P, UID_P)).isTrue();