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

Commit 01c63991 authored by Matías Hernández's avatar Matías Hernández Committed by Android (Google) Code Review
Browse files

Merge "Fix one of the strict-zen-validation tests" into main

parents c6366208 88839c0e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -244,8 +244,7 @@ public class NotificationManagerZenTest {
    }

    @Test
    @RequiresFlagsEnabled(FLAG_STRICT_ZEN_RULE_COMPONENT_VALIDATION)
    public void updateAutomaticZenRule_switchToInvalidCpsButWithValidConfigActivity_cpsGone() {
    public void updateAutomaticZenRule_switchToInvalidCpsButWithValidConfigActivity_cpsReverts() {
        AutomaticZenRule original = new AutomaticZenRule.Builder("OK so far", CONDITION_ID)
                .setOwner(CONDITION_PROVIDER_SERVICE)
                .setConfigurationActivity(CONFIGURATION_ACTIVITY)
@@ -257,9 +256,10 @@ public class NotificationManagerZenTest {
                .build();
        mNotificationManager.updateAutomaticZenRule(ruleId, sneaky);

        // Unlike for configurationActivity, an app cannot modify the CPS associated to an AZR.
        AutomaticZenRule savedAzr = mNotificationManager.getAutomaticZenRule(ruleId);
        assertThat(savedAzr).isNotNull();
        assertThat(savedAzr.getOwner()).isNull();
        assertThat(savedAzr.getOwner()).isEqualTo(CONDITION_PROVIDER_SERVICE);
        assertThat(savedAzr.getConfigurationActivity()).isEqualTo(CONFIGURATION_ACTIVITY);
    }