Use public APIs for modifying automatic zen rules.

Bug: 22977552
Change-Id: I544f1462ad77cdeb33ccff3c9de11ea37df5505d
This commit is contained in:
Julia Reynolds
2015-09-23 15:42:14 -04:00
parent 1556f3c371
commit 7d8a9aead5
7 changed files with 143 additions and 146 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.notification;
import static com.android.settings.notification.ZenModeScheduleDaysSelection.DAYS;
import android.app.AlertDialog;
import android.app.AutomaticZenRule;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.FragmentManager;
@@ -33,7 +34,6 @@ import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.service.notification.ZenModeConfig;
import android.service.notification.ZenModeConfig.ScheduleInfo;
import android.service.notification.ZenModeConfig.ZenRule;
import android.text.format.DateFormat;
import android.util.Log;
import android.widget.TimePicker;
@@ -62,8 +62,8 @@ public class ZenModeScheduleRuleSettings extends ZenModeRuleSettingsBase {
private ScheduleInfo mSchedule;
@Override
protected boolean setRule(ZenRule rule) {
mSchedule = rule != null ? ZenModeConfig.tryParseScheduleConditionId(rule.conditionId)
protected boolean setRule(AutomaticZenRule rule) {
mSchedule = rule != null ? ZenModeConfig.tryParseScheduleConditionId(rule.getConditionId())
: null;
return mSchedule != null;
}