Merge "Catch rule creation exceptions." into nyc-dev
am: f1c2e62f4e
* commit 'f1c2e62f4ec00205dc1e78ff66e77d8380d9a6f2':
Catch rule creation exceptions.
Change-Id: I2d5d9e15f0c86b700b8c3a058e3cf92e36591173
This commit is contained in:
@@ -96,11 +96,15 @@ abstract public class ZenModeSettingsBase extends RestrictedSettingsFragment {
|
||||
}
|
||||
|
||||
protected String addZenRule(AutomaticZenRule rule) {
|
||||
String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
|
||||
final AutomaticZenRule savedRule =
|
||||
NotificationManager.from(mContext).getAutomaticZenRule(id);
|
||||
maybeRefreshRules(savedRule != null, true);
|
||||
return id;
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user