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

Commit 0ce93167 authored by Yuri Lin's avatar Yuri Lin
Browse files

Don't convert conversation senders to the wrong enum

Bug: 276950971
Test: ZenModeConfigTest
Change-Id: I7efb90982dbc8102552abd8244c0ec06fff6601e
parent 245b979b
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -1008,9 +1008,8 @@ public class ZenModeConfig implements Parcelable {
                .allowAlarms(allowAlarms)
                .allowAlarms(allowAlarms)
                .allowMedia(allowMedia)
                .allowMedia(allowMedia)
                .allowSystem(allowSystem)
                .allowSystem(allowSystem)
                .allowConversations(allowConversations
                .allowConversations(allowConversations ? allowConversationsFrom
                        ? ZenModeConfig.getZenPolicySenders(allowConversationsFrom)
                        : ZenPolicy.CONVERSATION_SENDERS_NONE);
                        : ZenPolicy.PEOPLE_TYPE_NONE);
        if (suppressedVisualEffects == 0) {
        if (suppressedVisualEffects == 0) {
            builder.showAllVisualEffects();
            builder.showAllVisualEffects();
        } else {
        } else {
+12 −0
Original line number Original line Diff line number Diff line
@@ -120,12 +120,20 @@ public class ZenModeConfigTest extends UiServiceTestCase {
                .showLights(false)
                .showLights(false)
                .showBadges(false)
                .showBadges(false)
                .showInAmbientDisplay(false)
                .showInAmbientDisplay(false)
                .allowCalls(ZenPolicy.PEOPLE_TYPE_CONTACTS)
                .allowMessages(ZenPolicy.PEOPLE_TYPE_STARRED)
                .allowConversations(ZenPolicy.CONVERSATION_SENDERS_NONE)
                .build();
                .build();


        ZenModeConfig config = getMutedAllConfig();
        ZenModeConfig config = getMutedAllConfig();
        config.allowAlarms = true;
        config.allowAlarms = true;
        config.allowReminders = true;
        config.allowReminders = true;
        config.allowEvents = true;
        config.allowEvents = true;
        config.allowCalls = true;
        config.allowCallsFrom = Policy.PRIORITY_SENDERS_CONTACTS;
        config.allowMessages = true;
        config.allowMessagesFrom = Policy.PRIORITY_SENDERS_STARRED;
        config.allowConversations = false;
        config.suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_BADGE;
        config.suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_BADGE;
        config.suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_LIGHTS;
        config.suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_LIGHTS;
        config.suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_AMBIENT;
        config.suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_AMBIENT;
@@ -138,6 +146,10 @@ public class ZenModeConfigTest extends UiServiceTestCase {
        assertEquals(expected.getPriorityCategoryEvents(), actual.getPriorityCategoryEvents());
        assertEquals(expected.getPriorityCategoryEvents(), actual.getPriorityCategoryEvents());
        assertEquals(expected.getVisualEffectLights(), actual.getVisualEffectLights());
        assertEquals(expected.getVisualEffectLights(), actual.getVisualEffectLights());
        assertEquals(expected.getVisualEffectAmbient(), actual.getVisualEffectAmbient());
        assertEquals(expected.getVisualEffectAmbient(), actual.getVisualEffectAmbient());
        assertEquals(expected.getPriorityConversationSenders(),
                actual.getPriorityConversationSenders());
        assertEquals(expected.getPriorityCallSenders(), actual.getPriorityCallSenders());
        assertEquals(expected.getPriorityMessageSenders(), actual.getPriorityMessageSenders());
    }
    }


    @Test
    @Test