am 1880ad6a: Send correct busy status information in upsyncs to EAS

Merge commit '1880ad6a83120b89ed239858d27d3e63242160e6' into froyo-plus-aosp

* commit '1880ad6a83120b89ed239858d27d3e63242160e6':
  Send correct busy status information in upsyncs to EAS
This commit is contained in:
Marc Blank 2010-04-21 23:00:56 -07:00 committed by Android Git Automerger
commit d764ce7e44
2 changed files with 13 additions and 8 deletions

View File

@ -137,10 +137,15 @@ public class CalendarUtilities {
static final String ICALENDAR_ATTENDEE_TENTATIVE =
ICALENDAR_ATTENDEE + ";PARTSTAT=TENTATIVE";
public static final int BUSY_STATUS_BUSY = 0;
public static final int BUSY_STATUS_FREE = 1;
public static final int BUSY_STATUS_TENTATIVE = 2;
public static final int BUSY_STATUS_OOF = 3;
// Note that these constants apply to Calendar items
// For future reference: MeetingRequest data can also include free/busy information, but the
// constants for these four options in MeetingRequest data have different values!
// See [MS-ASCAL] 2.2.2.8 for Calendar BusyStatus
// See [MS-EMAIL] 2.2.2.34 for MeetingRequest BusyStatus
public static final int BUSY_STATUS_FREE = 0;
public static final int BUSY_STATUS_TENTATIVE = 1;
public static final int BUSY_STATUS_BUSY = 2;
public static final int BUSY_STATUS_OUT_OF_OFFICE = 3;
// Return a 4-byte long from a byte array (little endian)
static int getLong(byte[] bytes, int offset) {
@ -1233,7 +1238,7 @@ public class CalendarUtilities {
selfAttendeeStatus = Attendees.ATTENDEE_STATUS_TENTATIVE;
break;
case BUSY_STATUS_FREE:
case BUSY_STATUS_OOF:
case BUSY_STATUS_OUT_OF_OFFICE:
default:
selfAttendeeStatus = Attendees.ATTENDEE_STATUS_NONE;
}

View File

@ -727,17 +727,17 @@ public class CalendarUtilitiesTests extends AndroidTestCase {
CalendarUtilities.BUSY_STATUS_FREE));
assertEquals(Attendees.ATTENDEE_STATUS_NONE,
CalendarUtilities.selfAttendeeStatusFromBusyStatus(
CalendarUtilities.BUSY_STATUS_OOF));
CalendarUtilities.BUSY_STATUS_OUT_OF_OFFICE));
}
public void testBusyStatusFromSelfStatus() {
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
Attendees.ATTENDEE_STATUS_DECLINED));
assertEquals(CalendarUtilities.BUSY_STATUS_BUSY,
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
Attendees.ATTENDEE_STATUS_NONE));
assertEquals(CalendarUtilities.BUSY_STATUS_BUSY,
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
Attendees.ATTENDEE_STATUS_INVITED));
assertEquals(CalendarUtilities.BUSY_STATUS_TENTATIVE,