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

Commit 992422fd authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Catch rule creation exceptions.

Bug: 28775583
Change-Id: I54c4af0352c88b27717660741709ec54e4749656
parent 15c1bb48
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -96,11 +96,15 @@ abstract public class ZenModeSettingsBase extends RestrictedSettingsFragment {
    }

    protected String addZenRule(AutomaticZenRule rule) {
        try {
            String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
            final AutomaticZenRule savedRule =
                    NotificationManager.from(mContext).getAutomaticZenRule(id);
            maybeRefreshRules(savedRule != null, true);
            return id;
        } catch (Exception e) {
            return null;
        }
    }

    protected boolean setZenRule(String id, AutomaticZenRule rule) {