Merge "Catch rule creation exceptions." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f1c2e62f4e
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user