Merge "Catch rule creation exceptions." into nyc-dev am: f1c2e62f4e am: 84082aac24

am: c34538754a

* commit 'c34538754a9d18506f7c2d71e2db7c6a26fa2473':
  Catch rule creation exceptions.

Change-Id: If2fecb8e96d4c468050fd560135b1d1034717102
This commit is contained in:
Julia Reynolds
2016-05-16 18:39:22 +00:00
committed by android-build-merger

View File

@@ -96,11 +96,15 @@ abstract public class ZenModeSettingsBase extends RestrictedSettingsFragment {
} }
protected String addZenRule(AutomaticZenRule rule) { protected String addZenRule(AutomaticZenRule rule) {
try {
String id = NotificationManager.from(mContext).addAutomaticZenRule(rule); String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
final AutomaticZenRule savedRule = final AutomaticZenRule savedRule =
NotificationManager.from(mContext).getAutomaticZenRule(id); NotificationManager.from(mContext).getAutomaticZenRule(id);
maybeRefreshRules(savedRule != null, true); maybeRefreshRules(savedRule != null, true);
return id; return id;
} catch (Exception e) {
return null;
}
} }
protected boolean setZenRule(String id, AutomaticZenRule rule) { protected boolean setZenRule(String id, AutomaticZenRule rule) {