Merge "Catch rule creation exceptions." into nyc-dev am: f1c2e62f4e
am: 84082aac24
* commit '84082aac240febc46d6db1b94530b047e522b200':
Catch rule creation exceptions.
Change-Id: I99aeb96b8e8b9494a4e388f53e52bdb90288970d
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) {
|
||||||
|
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