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

Commit f1c2e62f authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Catch rule creation exceptions." into nyc-dev

parents fcc411c8 992422fd
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) {