diff options
| -rw-r--r-- | services/core/java/com/android/server/notification/CalendarTracker.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/notification/CalendarTracker.java b/services/core/java/com/android/server/notification/CalendarTracker.java index c82df4827f53..28da73ccb3ed 100644 --- a/services/core/java/com/android/server/notification/CalendarTracker.java +++ b/services/core/java/com/android/server/notification/CalendarTracker.java @@ -47,6 +47,7 @@ public class CalendarTracker { Instances.EVENT_ID, Instances.OWNER_ACCOUNT, Instances.CALENDAR_ID, + Instances.AVAILABILITY, }; private static final String INSTANCE_ORDER_BY = Instances.BEGIN + " ASC"; @@ -143,11 +144,14 @@ public class CalendarTracker { final int eventId = cursor.getInt(4); final String owner = cursor.getString(5); final long calendarId = cursor.getLong(6); - if (DEBUG) Log.d(TAG, String.format("%s %s-%s v=%s eid=%s o=%s cid=%s", title, - new Date(begin), new Date(end), visible, eventId, owner, calendarId)); + final int availability = cursor.getInt(7); + if (DEBUG) Log.d(TAG, String.format("%s %s-%s v=%s a=%s eid=%s o=%s cid=%s", title, + new Date(begin), new Date(end), visible, availabilityToString(availability), + eventId, owner, calendarId)); final boolean meetsTime = time >= begin && time < end; final boolean meetsCalendar = visible - && (filter.calendar == 0 || filter.calendar == calendarId); + && (filter.calendar == 0 || filter.calendar == calendarId) + && availability != Instances.AVAILABILITY_FREE; if (meetsCalendar) { if (DEBUG) Log.d(TAG, " MEETS CALENDAR"); final boolean meetsAttendee = meetsAttendee(filter, eventId, owner); @@ -228,6 +232,15 @@ public class CalendarTracker { } } + private static String availabilityToString(int availability) { + switch (availability) { + case Instances.AVAILABILITY_BUSY: return "AVAILABILITY_BUSY"; + case Instances.AVAILABILITY_FREE: return "AVAILABILITY_FREE"; + case Instances.AVAILABILITY_TENTATIVE: return "AVAILABILITY_TENTATIVE"; + default: return "AVAILABILITY_UNKNOWN_" + availability; + } + } + private static boolean meetsReply(int reply, int attendeeStatus) { switch (reply) { case EventInfo.REPLY_YES: |