Settings: Migrate zen event conditions to use calendar name.

And make sure any existing calendar value always appears in the
picker, even before it exists in the calendar provider.

Bug: 17755700
Change-Id: I8aa298a0d5804c288e2596f18c2dc7318f752121
This commit is contained in:
John Spurlock
2015-05-28 22:20:44 -04:00
parent e6f9c110c7
commit bd352af3cf
3 changed files with 19 additions and 17 deletions

View File

@@ -214,13 +214,8 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
}
private String computeCalendarName(EventInfo event) {
if (event.calendar != EventInfo.ANY_CALENDAR) {
final CalendarInfo calendar = ZenModeEventRuleSettings.findCalendar(mContext, event);
if (calendar != null) {
return calendar.name;
}
}
return getString(R.string.zen_mode_event_rule_summary_any_calendar);
return event.calendar != null ? event.calendar
: getString(R.string.zen_mode_event_rule_summary_any_calendar);
}
private int computeReply(EventInfo event) {