summaryrefslogtreecommitdiffstats
path: root/services/core/java/com
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-05-05 14:42:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-05 14:42:03 +0000
commit0bc8afff7eb3b5af72b7e9a4ce3954488bfbecd0 (patch)
tree81281bccf0bd8f098fd9b63a385b27f94bd15401 /services/core/java/com
parentd4474cb9454c7a8b907c0be07236ffed4ecf3fd8 (diff)
parentd39af2d3f8c5d87e102aeb79d4148218ff616245 (diff)
downloadframeworks_base-0bc8afff7eb3b5af72b7e9a4ce3954488bfbecd0.zip
frameworks_base-0bc8afff7eb3b5af72b7e9a4ce3954488bfbecd0.tar.gz
frameworks_base-0bc8afff7eb3b5af72b7e9a4ce3954488bfbecd0.tar.bz2
Merge "Zen: Remove calendar rule attendance attribute." into mnc-dev
Diffstat (limited to 'services/core/java/com')
-rw-r--r--services/core/java/com/android/server/notification/CalendarTracker.java38
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;
}
}