Use id-based zen rule APIs.
Also names no longer have to be unique. Bug: 22977552 Change-Id: I8dbee85c15d12d5380345447047a0d49c903522e
This commit is contained in:
@@ -87,16 +87,23 @@ abstract public class ZenModeSettingsBase extends RestrictedSettingsFragment {
|
||||
}
|
||||
}
|
||||
|
||||
protected AutomaticZenRule addZenRule(AutomaticZenRule rule) {
|
||||
final AutomaticZenRule savedRule =
|
||||
NotificationManager.from(mContext).addAutomaticZenRule(rule);
|
||||
maybeRefreshRules(savedRule != null, true);
|
||||
return savedRule;
|
||||
}
|
||||
|
||||
protected boolean setZenRule(AutomaticZenRule rule) {
|
||||
final boolean success =
|
||||
NotificationManager.from(mContext).addOrUpdateAutomaticZenRule(rule);
|
||||
NotificationManager.from(mContext).updateAutomaticZenRule(rule);
|
||||
maybeRefreshRules(success, true);
|
||||
return success;
|
||||
}
|
||||
|
||||
protected boolean removeZenRule(String name) {
|
||||
protected boolean removeZenRule(String id) {
|
||||
final boolean success =
|
||||
NotificationManager.from(mContext).removeAutomaticZenRule(name);
|
||||
NotificationManager.from(mContext).removeAutomaticZenRule(id);
|
||||
maybeRefreshRules(success, true);
|
||||
return success;
|
||||
}
|
||||
|
Reference in New Issue
Block a user