Send correct busy status information in upsyncs to EAS
* Fix unit test that was failing Bug: 2615382 Change-Id: I54c7bdd982d57528f55ce4f4c6804c9f532293fb
This commit is contained in:
parent
5d5d7854c2
commit
1880ad6a83
@ -137,10 +137,15 @@ public class CalendarUtilities {
|
|||||||
static final String ICALENDAR_ATTENDEE_TENTATIVE =
|
static final String ICALENDAR_ATTENDEE_TENTATIVE =
|
||||||
ICALENDAR_ATTENDEE + ";PARTSTAT=TENTATIVE";
|
ICALENDAR_ATTENDEE + ";PARTSTAT=TENTATIVE";
|
||||||
|
|
||||||
public static final int BUSY_STATUS_BUSY = 0;
|
// Note that these constants apply to Calendar items
|
||||||
public static final int BUSY_STATUS_FREE = 1;
|
// For future reference: MeetingRequest data can also include free/busy information, but the
|
||||||
public static final int BUSY_STATUS_TENTATIVE = 2;
|
// constants for these four options in MeetingRequest data have different values!
|
||||||
public static final int BUSY_STATUS_OOF = 3;
|
// 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)
|
// Return a 4-byte long from a byte array (little endian)
|
||||||
static int getLong(byte[] bytes, int offset) {
|
static int getLong(byte[] bytes, int offset) {
|
||||||
@ -1233,7 +1238,7 @@ public class CalendarUtilities {
|
|||||||
selfAttendeeStatus = Attendees.ATTENDEE_STATUS_TENTATIVE;
|
selfAttendeeStatus = Attendees.ATTENDEE_STATUS_TENTATIVE;
|
||||||
break;
|
break;
|
||||||
case BUSY_STATUS_FREE:
|
case BUSY_STATUS_FREE:
|
||||||
case BUSY_STATUS_OOF:
|
case BUSY_STATUS_OUT_OF_OFFICE:
|
||||||
default:
|
default:
|
||||||
selfAttendeeStatus = Attendees.ATTENDEE_STATUS_NONE;
|
selfAttendeeStatus = Attendees.ATTENDEE_STATUS_NONE;
|
||||||
}
|
}
|
||||||
|
@ -727,17 +727,17 @@ public class CalendarUtilitiesTests extends AndroidTestCase {
|
|||||||
CalendarUtilities.BUSY_STATUS_FREE));
|
CalendarUtilities.BUSY_STATUS_FREE));
|
||||||
assertEquals(Attendees.ATTENDEE_STATUS_NONE,
|
assertEquals(Attendees.ATTENDEE_STATUS_NONE,
|
||||||
CalendarUtilities.selfAttendeeStatusFromBusyStatus(
|
CalendarUtilities.selfAttendeeStatusFromBusyStatus(
|
||||||
CalendarUtilities.BUSY_STATUS_OOF));
|
CalendarUtilities.BUSY_STATUS_OUT_OF_OFFICE));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBusyStatusFromSelfStatus() {
|
public void testBusyStatusFromSelfStatus() {
|
||||||
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
|
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
|
||||||
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
|
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
|
||||||
Attendees.ATTENDEE_STATUS_DECLINED));
|
Attendees.ATTENDEE_STATUS_DECLINED));
|
||||||
assertEquals(CalendarUtilities.BUSY_STATUS_BUSY,
|
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
|
||||||
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
|
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
|
||||||
Attendees.ATTENDEE_STATUS_NONE));
|
Attendees.ATTENDEE_STATUS_NONE));
|
||||||
assertEquals(CalendarUtilities.BUSY_STATUS_BUSY,
|
assertEquals(CalendarUtilities.BUSY_STATUS_FREE,
|
||||||
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
|
CalendarUtilities.busyStatusFromSelfAttendeeStatus(
|
||||||
Attendees.ATTENDEE_STATUS_INVITED));
|
Attendees.ATTENDEE_STATUS_INVITED));
|
||||||
assertEquals(CalendarUtilities.BUSY_STATUS_TENTATIVE,
|
assertEquals(CalendarUtilities.BUSY_STATUS_TENTATIVE,
|
||||||
|
Loading…
Reference in New Issue
Block a user