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

Commit 39ff4f89 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add test for null-pointer in ZenModeHelperTest"

parents bc0e00ca ac7733cd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1030,6 +1030,14 @@ public class ZenModeHelperTest extends UiServiceTestCase {
        assertEquals(1, mZenModeHelperSpy.mConditions.mSubscriptions.size());
    }

    @Test
    public void testEmptyDefaultRulesMap() {
        ZenModeConfig config = new ZenModeConfig();
        config.automaticRules = new ArrayMap<>();
        mZenModeHelperSpy.mConfig = config;
        mZenModeHelperSpy.updateDefaultZenRules(); // shouldn't throw null pointer
    }

    private void setupZenConfig() {
        mZenModeHelperSpy.mZenMode = Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
        mZenModeHelperSpy.mConfig.allowAlarms = false;