diff options
author | Michael Chan <mchan@android.com> | 2009-09-11 14:42:31 -0700 |
---|---|---|
committer | Michael Chan <mchan@android.com> | 2009-09-11 14:42:31 -0700 |
commit | 6d34cec523930368976bc8d358d0a6de1da3462c (patch) | |
tree | 1a7eb3ad8c0f433649fa02e4531fe596d6cb1680 /src/com/android/calendar/Event.java | |
parent | 782e389d19f0183c9855117c8752c79a7bff6531 (diff) | |
download | android_packages_apps_Calendar-6d34cec523930368976bc8d358d0a6de1da3462c.tar.gz android_packages_apps_Calendar-6d34cec523930368976bc8d358d0a6de1da3462c.tar.bz2 android_packages_apps_Calendar-6d34cec523930368976bc8d358d0a6de1da3462c.zip |
b/2098823 Fixed the problem where Delete and Edit Event weren't showing in long press menus. Make use of the new organizer and guestCanModifyEvent columns.
Diffstat (limited to 'src/com/android/calendar/Event.java')
-rw-r--r-- | src/com/android/calendar/Event.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com/android/calendar/Event.java b/src/com/android/calendar/Event.java index 9061cda2..956a0f6c 100644 --- a/src/com/android/calendar/Event.java +++ b/src/com/android/calendar/Event.java @@ -23,6 +23,7 @@ import android.database.Cursor; import android.os.Debug; import android.preference.PreferenceManager; import android.provider.Calendar.Attendees; +import android.provider.Calendar.Events; import android.provider.Calendar.Instances; import android.text.TextUtils; import android.text.format.DateUtils; @@ -56,6 +57,8 @@ public class Event implements Comparable, Cloneable { Instances.RRULE, // 14 Instances.RDATE, // 15 Instances.SELF_ATTENDEE_STATUS, // 16 + Events.ORGANIZER, // 17 + Events.GUESTS_CAN_MODIFY, // 18 }; // The indices for the projection array above. @@ -75,12 +78,16 @@ public class Event implements Comparable, Cloneable { private static final int PROJECTION_RRULE_INDEX = 14; private static final int PROJECTION_RDATE_INDEX = 15; private static final int PROJECTION_SELF_ATTENDEE_STATUS_INDEX = 16; + private static final int PROJECTION_ORGANIZER_INDEX = 17; + private static final int PROJECTION_GUESTS_CAN_INVITE_OTHERS_INDEX = 18; public long id; public int color; public CharSequence title; public CharSequence location; public boolean allDay; + public String organizer; + public boolean guestsCanModify; public int startDay; // start Julian day public int endDay; // end Julian day @@ -130,6 +137,8 @@ public class Event implements Comparable, Cloneable { e.hasAlarm = hasAlarm; e.isRepeating = isRepeating; e.selfAttendeeStatus = selfAttendeeStatus; + e.organizer = organizer; + e.guestsCanModify = guestsCanModify; return e; } @@ -149,6 +158,8 @@ public class Event implements Comparable, Cloneable { dest.hasAlarm = hasAlarm; dest.isRepeating = isRepeating; dest.selfAttendeeStatus = selfAttendeeStatus; + dest.organizer = organizer; + dest.guestsCanModify = guestsCanModify; } public static final Event newInstance() { @@ -196,6 +207,9 @@ public class Event implements Comparable, Cloneable { if (allDay && !e.allDay) return -1; if (!allDay && e.allDay) return 1; + if (guestsCanModify && !e.guestsCanModify) return -1; + if (!guestsCanModify && e.guestsCanModify) return 1; + // If two events have the same time range, then sort them in // alphabetical order based on their titles. int cmp = compareStrings(title, e.title); @@ -210,6 +224,11 @@ public class Event implements Comparable, Cloneable { if (cmp != 0) { return cmp; } + + cmp = compareStrings(organizer, e.organizer); + if (cmp != 0) { + return cmp; + } return 0; } @@ -316,6 +335,9 @@ public class Event implements Comparable, Cloneable { e.title = c.getString(PROJECTION_TITLE_INDEX); e.location = c.getString(PROJECTION_LOCATION_INDEX); e.allDay = c.getInt(PROJECTION_ALL_DAY_INDEX) != 0; + e.organizer = c.getString(PROJECTION_ORGANIZER_INDEX); + e.guestsCanModify = c.getInt(PROJECTION_GUESTS_CAN_INVITE_OTHERS_INDEX) != 0; + String timezone = c.getString(PROJECTION_TIMEZONE_INDEX); if (e.title == null || e.title.length() == 0) { @@ -538,6 +560,8 @@ public class Event implements Comparable, Cloneable { Log.e("Cal", "+ endDay = " + endDay); Log.e("Cal", "+ startTime = " + startTime); Log.e("Cal", "+ endTime = " + endTime); + Log.e("Cal", "+ organizer = " + organizer); + Log.e("Cal", "+ guestwrt = " + guestsCanModify); } public final boolean intersects(int julianDay, int startMinute, |