diff options
author | John Spurlock <jspurlock@google.com> | 2015-05-05 09:49:32 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-05-05 09:49:32 -0400 |
commit | d39af2d3f8c5d87e102aeb79d4148218ff616245 (patch) | |
tree | 9fe27d1f3dcaa5102eff2b161ba6442b9f281b2a /services/core/java/com | |
parent | ad2399f3be4861d0f5acf072460d98fafc951c57 (diff) | |
download | frameworks_base-d39af2d3f8c5d87e102aeb79d4148218ff616245.zip frameworks_base-d39af2d3f8c5d87e102aeb79d4148218ff616245.tar.gz frameworks_base-d39af2d3f8c5d87e102aeb79d4148218ff616245.tar.bz2 |
Zen: Remove calendar rule attendance attribute.
- No longer supporting a filter based on attendance type.
- Remove from model + condition provider logic.
Bug: 20064962
Change-Id: I0bc16275a2860ab95d4de316b6326a1499003f05
Diffstat (limited to 'services/core/java/com')
-rw-r--r-- | services/core/java/com/android/server/notification/CalendarTracker.java | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/services/core/java/com/android/server/notification/CalendarTracker.java b/services/core/java/com/android/server/notification/CalendarTracker.java index 8734d97..c82df48 100644 --- a/services/core/java/com/android/server/notification/CalendarTracker.java +++ b/services/core/java/com/android/server/notification/CalendarTracker.java @@ -55,7 +55,6 @@ public class CalendarTracker { Attendees.EVENT_ID, Attendees.ATTENDEE_EMAIL, Attendees.ATTENDEE_STATUS, - Attendees.ATTENDEE_TYPE, }; private static final String ATTENDEE_SELECTION = Attendees.EVENT_ID + " = ? AND " @@ -191,16 +190,13 @@ public class CalendarTracker { final long rowEventId = cursor.getLong(0); final String rowEmail = cursor.getString(1); final int status = cursor.getInt(2); - final int type = cursor.getInt(3); final boolean meetsReply = meetsReply(filter.reply, status); - final boolean meetsAttendance = meetsAttendance(filter.attendance, type); if (DEBUG) Log.d(TAG, (DEBUG_ATTENDEES ? String.format( "rowEventId=%s, rowEmail=%s, ", rowEventId, rowEmail) : "") + - String.format("status=%s, type=%s, meetsReply=%s, meetsAttendance=%s", - attendeeStatusToString(status), attendeeTypeToString(type), meetsReply, - meetsAttendance)); + String.format("status=%s, meetsReply=%s", + attendeeStatusToString(status), meetsReply)); final boolean eventMeets = rowEventId == eventId && Objects.equals(rowEmail, email) - && meetsReply && meetsAttendance; + && meetsReply; rt |= eventMeets; } return rt; @@ -232,35 +228,17 @@ public class CalendarTracker { } } - private static String attendeeTypeToString(int type) { - switch (type) { - case Attendees.TYPE_NONE: return "TYPE_NONE"; - case Attendees.TYPE_REQUIRED: return "TYPE_REQUIRED"; - case Attendees.TYPE_OPTIONAL: return "TYPE_OPTIONAL"; - case Attendees.TYPE_RESOURCE: return "TYPE_RESOURCE"; - default: return "TYPE_" + type; - } - } - - private static boolean meetsAttendance(int attendance, int attendeeType) { - switch (attendance) { - case EventInfo.ATTENDANCE_OPTIONAL: - return attendeeType == Attendees.TYPE_OPTIONAL; - case EventInfo.ATTENDANCE_REQUIRED: - return attendeeType == Attendees.TYPE_REQUIRED; - default: // EventInfo.ATTENDANCE_REQUIRED_OR_OPTIONAL - return true; - } - } - private static boolean meetsReply(int reply, int attendeeStatus) { switch (reply) { case EventInfo.REPLY_YES: return attendeeStatus == Attendees.ATTENDEE_STATUS_ACCEPTED; + case EventInfo.REPLY_YES_OR_MAYBE: + return attendeeStatus == Attendees.ATTENDEE_STATUS_ACCEPTED + || attendeeStatus == Attendees.ATTENDEE_STATUS_TENTATIVE; case EventInfo.REPLY_ANY_EXCEPT_NO: return attendeeStatus != Attendees.ATTENDEE_STATUS_DECLINED; - default: // EventInfo.REPLY_ANY - return true; + default: + return false; } } |