Don't add "Invitation: " to meeting invitations

* Turns out that most other clients omit this.
* This has the pleasing effect of fixing the referenced bug
* Update unit tests

Bug: 2561821
Change-Id: I39f7db7e05be590373cd5f3d9b23c7ee21bde4f7
This commit is contained in:
Marc Blank 2010-04-01 13:08:12 -07:00
parent 82701d7725
commit 78021cbbf8
3 changed files with 11 additions and 12 deletions

View File

@ -19,6 +19,8 @@
<!-- Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,
and remove the actual text. These will be removed in a bulk operation. -->
<!-- Do Not Translate. Unused string. -->
<string name="meeting_invitation"></string>
<!-- Do Not Translate. Unused string. -->
<string name="account_setup_failed_security_policies_required"></string>
<!-- Do Not Translate. Unused string. -->
<string name="account_folder_list_summary_unread"></string>
@ -628,10 +630,6 @@
<!-- Name of Microsoft Exchange account type; used by AccountManager -->
<string name="exchange_name_alternate">Microsoft Exchange ActiveSync</string>
<!-- Message subject for meeting invitation. This is followed by a colon
and the title of the meeting (i.e. the title of the meeting becomes part of the subject of
the message that's sent) -->
<string name="meeting_invitation">Invitation: <xliff:g id="subject">%s</xliff:g></string>
<!-- Message subject for meeting accepted response. This will be followed by a colon
and the title of the meeting (i.e. the title of the meeting becomes part of the subject of
the message that's sent) -->

View File

@ -1322,12 +1322,11 @@ public class CalendarUtilities {
sequence = "0";
}
// We'll use 0 to mean a meeting invitation
int titleId = 0;
switch (messageFlag) {
case Message.FLAG_OUTGOING_MEETING_INVITE:
if (sequence.equals("0")) {
titleId = R.string.meeting_invitation;
} else {
if (!sequence.equals("0")) {
titleId = R.string.meeting_updated;
}
break;
@ -1350,7 +1349,11 @@ public class CalendarUtilities {
title = "";
}
ics.writeTag("SUMMARY", title);
if (titleId != 0) {
// For meeting invitations just use the title
if (titleId == 0) {
msg.mSubject = title;
} else {
// Otherwise, use the additional text
msg.mSubject = resources.getString(titleId, title);
}

View File

@ -287,8 +287,7 @@ public class CalendarUtilitiesTests extends AndroidTestCase {
// Now check some of the fields of the message
assertEquals(Address.pack(new Address[] {new Address(ATTENDEE)}), msg.mTo);
String accept = getContext().getResources().getString(R.string.meeting_invitation, title);
assertEquals(accept, msg.mSubject);
assertEquals(title, msg.mSubject);
// And make sure we have an attachment
assertNotNull(msg.mAttachments);
@ -350,8 +349,7 @@ public class CalendarUtilitiesTests extends AndroidTestCase {
// Now check some of the fields of the message
assertEquals(Address.pack(new Address[] {new Address(ATTENDEE)}), msg.mTo);
String accept = getContext().getResources().getString(R.string.meeting_invitation, title);
assertEquals(accept, msg.mSubject);
assertEquals(title, msg.mSubject);
// And make sure we have an attachment
assertNotNull(msg.mAttachments);