Catch rule creation exceptions.
Bug: 28775583 Change-Id: I54c4af0352c88b27717660741709ec54e4749656
This commit is contained in:
@@ -96,11 +96,15 @@ abstract public class ZenModeSettingsBase extends RestrictedSettingsFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String addZenRule(AutomaticZenRule rule) {
|
protected String addZenRule(AutomaticZenRule rule) {
|
||||||
String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
|
try {
|
||||||
final AutomaticZenRule savedRule =
|
String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
|
||||||
NotificationManager.from(mContext).getAutomaticZenRule(id);
|
final AutomaticZenRule savedRule =
|
||||||
maybeRefreshRules(savedRule != null, true);
|
NotificationManager.from(mContext).getAutomaticZenRule(id);
|
||||||
return id;
|
maybeRefreshRules(savedRule != null, true);
|
||||||
|
return id;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean setZenRule(String id, AutomaticZenRule rule) {
|
protected boolean setZenRule(String id, AutomaticZenRule rule) {
|
||||||
|
Reference in New Issue
Block a user