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

@@ -16,6 +16,7 @@
package com.android.settings.notification;
import android.app.AutomaticZenRule;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.database.Cursor;
@@ -28,7 +29,6 @@ import android.provider.CalendarContract.Calendars;
import android.provider.Settings;
import android.service.notification.ZenModeConfig;
import android.service.notification.ZenModeConfig.EventInfo;
import android.service.notification.ZenModeConfig.ZenRule;
import com.android.internal.logging.MetricsLogger;
import com.android.settings.DropDownPreference;
@@ -53,8 +53,8 @@ public class ZenModeEventRuleSettings extends ZenModeRuleSettingsBase {
private boolean mCreate;
@Override
protected boolean setRule(ZenRule rule) {
mEvent = rule != null ? ZenModeConfig.tryParseEventConditionId(rule.conditionId)
protected boolean setRule(AutomaticZenRule rule) {
mEvent = rule != null ? ZenModeConfig.tryParseEventConditionId(rule.getConditionId())
: null;
return mEvent != null;
}