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
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9ae2617..52f46f5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -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) -->
diff --git a/src/com/android/exchange/utility/CalendarUtilities.java b/src/com/android/exchange/utility/CalendarUtilities.java
index feec1a9..a458b24 100644
--- a/src/com/android/exchange/utility/CalendarUtilities.java
+++ b/src/com/android/exchange/utility/CalendarUtilities.java
@@ -1322,12 +1322,11 @@
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 @@
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);
}
diff --git a/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java b/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java
index 0a83964..67172f3 100644
--- a/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java
+++ b/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java
@@ -287,8 +287,7 @@
// 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 @@
// 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);