More recipient tests for reply/reply all/ fwd.
Also added _column to the end of the html_body and text_body
fields for message columns.
Change-Id: I565a89d9eb811d122ca7aafd62b15a97c3cfe484
diff --git a/src/com/android/mail/compose/QuotedTextView.java b/src/com/android/mail/compose/QuotedTextView.java
index f52fa16..0d28423 100644
--- a/src/com/android/mail/compose/QuotedTextView.java
+++ b/src/com/android/mail/compose/QuotedTextView.java
@@ -252,7 +252,7 @@
refMessage.getString(UIProvider.MESSAGE_FROM_COLUMN), true)));
quotedText.append(HEADER_SEPARATOR);
quotedText.append(BLOCKQUOTE_BEGIN);
- quotedText.append(refMessage.getString(UIProvider.MESSAGE_BODY_HTML));
+ quotedText.append(refMessage.getString(UIProvider.MESSAGE_BODY_HTML_COLUMN));
quotedText.append(BLOCKQUOTE_END);
quotedText.append(QUOTE_END);
} else if (action == ComposeActivity.FORWARD) {
@@ -269,7 +269,7 @@
Utils.cleanUpString(ccAddresses, true /* remove empty quotes */)));
}
quotedText.append(HEADER_SEPARATOR);
- quotedText.append(refMessage.getString(UIProvider.MESSAGE_BODY_HTML));
+ quotedText.append(refMessage.getString(UIProvider.MESSAGE_BODY_HTML_COLUMN));
quotedText.append(QUOTE_END);
setQuotedText(quotedText);
allowQuotedText(allow);
diff --git a/src/com/android/mail/providers/UIProvider.java b/src/com/android/mail/providers/UIProvider.java
index a280a37..8606248 100644
--- a/src/com/android/mail/providers/UIProvider.java
+++ b/src/com/android/mail/providers/UIProvider.java
@@ -352,8 +352,8 @@
public static final int MESSAGE_BCC_COLUMN = 9;
public static final int MESSAGE_REPLY_TO_COLUMN = 10;
public static final int MESSAGE_DATE_RECEIVED_MS_COLUMN = 11;
- public static final int MESSAGE_BODY_HTML = 12;
- public static final int MESSAGE_BODY_TEXT = 13;
+ public static final int MESSAGE_BODY_HTML_COLUMN = 12;
+ public static final int MESSAGE_BODY_TEXT_COLUMN = 13;
public static final int MESSAGE_EMBEDS_EXTERNAL_RESOURCES_COLUMN = 14;
public static final int MESSAGE_REF_MESSAGE_ID_COLUMN = 15;
public static final int MESSAGE_DRAFT_TYPE_COLUMN = 16;
diff --git a/src/com/android/mail/providers/protos/mock/MockUiProvider.java b/src/com/android/mail/providers/protos/mock/MockUiProvider.java
index 6229399..085e0ba 100644
--- a/src/com/android/mail/providers/protos/mock/MockUiProvider.java
+++ b/src/com/android/mail/providers/protos/mock/MockUiProvider.java
@@ -66,21 +66,21 @@
// Add results for account list
final List<Map<String, Object>> accountList = Lists.newArrayList();
- Map<String, Object> accountDetailsMap1;
+ Map<String, Object> accountDetailsMap0;
// Account 1
- accountDetailsMap1 = createAccountDetailsMap(0);
+ accountDetailsMap0 = createAccountDetailsMap(0);
- accountList.add(accountDetailsMap1);
- String accountUri1 = (String)accountDetailsMap1.get(AccountColumns.URI);
- builder.put(accountUri1, ImmutableList.of(accountDetailsMap1));
+ accountList.add(accountDetailsMap0);
+ String accountUri1 = (String)accountDetailsMap0.get(AccountColumns.URI);
+ builder.put(accountUri1, ImmutableList.of(accountDetailsMap0));
// Account 2
- Map<String, Object> accountDetailsMap2 = createAccountDetailsMap(1);
- accountList.add(accountDetailsMap2);
+ Map<String, Object> accountDetailsMap1 = createAccountDetailsMap(1);
+ accountList.add(accountDetailsMap1);
- String accountUri2 = (String) accountDetailsMap2.get(AccountColumns.URI);
- builder.put(accountUri2, ImmutableList.of(accountDetailsMap2));
+ String accountUri2 = (String) accountDetailsMap1.get(AccountColumns.URI);
+ builder.put(accountUri2, ImmutableList.of(accountDetailsMap1));
// Add the account list to the builder
builder.put(getAccountsUri().toString(), accountList);
@@ -105,17 +105,17 @@
ImmutableList.of(conv0, conv1));
Map<String, Object> message0 = createMessageDetailsMap("zeroConv0".hashCode(), "zeroConv0",
- 1);
+ 1, false);
builder.put(message0.get(MessageColumns.URI).toString(), ImmutableList.of(message0));
builder.put(conv0.get(ConversationColumns.MESSAGE_LIST_URI).toString(),
ImmutableList.of(message0));
builder.put(message0.get(MessageColumns.ATTACHMENT_LIST_URI).toString(),
ImmutableList.of(createAttachmentDetailsMap(0, "zero")));
Map<String, Object> message1 = createMessageDetailsMap("zeroConv1".hashCode(), "zeroConv1",
- 1);
+ 1, false);
builder.put(message1.get(MessageColumns.URI).toString(), ImmutableList.of(message1));
Map<String, Object> message1a = createMessageDetailsMap("zeroConv1a".hashCode(), "zeroConv1a",
- 2);
+ 2, false);
builder.put(message1a.get(MessageColumns.URI).toString(), ImmutableList.of(message1a));
builder.put(conv1.get(ConversationColumns.MESSAGE_LIST_URI).toString(),
ImmutableList.of(message1, message1a));
@@ -125,7 +125,7 @@
Map<String, Object> folderDetailsMap1 = createFolderDetailsMap(1, "one", 0, 0);
builder.put(folderDetailsMap1.get(FolderColumns.URI).toString(),
ImmutableList.of(folderDetailsMap1));
- builder.put(accountDetailsMap1.get(AccountColumns.FOLDER_LIST_URI).toString(),
+ builder.put(accountDetailsMap0.get(AccountColumns.FOLDER_LIST_URI).toString(),
ImmutableList.of(folderDetailsMap0, folderDetailsMap1));
Map<String, Object> folderDetailsMap2 = createFolderDetailsMap(2, "two", 2, 2);
@@ -134,7 +134,7 @@
Map<String, Object> folderDetailsMap3 = createFolderDetailsMap(3, "three", 0, 0);
builder.put(folderDetailsMap3.get(FolderColumns.URI).toString(),
ImmutableList.of(folderDetailsMap3));
- builder.put(accountDetailsMap2.get(AccountColumns.FOLDER_LIST_URI).toString(),
+ builder.put(accountDetailsMap1.get(AccountColumns.FOLDER_LIST_URI).toString(),
ImmutableList.of(folderDetailsMap2, folderDetailsMap3));
Map<String, Object> conv2 = createConversationDetailsMap("zeroConv2".hashCode(),
@@ -149,12 +149,12 @@
ImmutableList.of(conv2, conv3));
Map<String, Object> message2 = createMessageDetailsMap("zeroConv2".hashCode(), "zeroConv2",
- 0);
+ 0, true);
builder.put(message2.get(MessageColumns.URI).toString(), ImmutableList.of(message2));
builder.put(conv2.get(ConversationColumns.MESSAGE_LIST_URI).toString(),
ImmutableList.of(message2));
Map<String, Object> message3 = createMessageDetailsMap("zeroConv3".hashCode(), "zeroConv3",
- 0);
+ 0, true);
builder.put(message3.get(MessageColumns.URI).toString(), ImmutableList.of(message3));
builder.put(conv3.get(ConversationColumns.MESSAGE_LIST_URI).toString(),
ImmutableList.of(message3));
@@ -178,7 +178,7 @@
}
private static Map<String, Object> createMessageDetailsMap(int messageId, String subject,
- int hasAttachments) {
+ int hasAttachments, boolean addReplyTo) {
final String messageUri = "content://" + AUTHORITY + "/message/" + messageId;
Map<String, Object> messageMap = Maps.newHashMap();
messageMap.put(BaseColumns._ID, Long.valueOf(messageId));
@@ -193,6 +193,9 @@
messageMap.put(MessageColumns.ATTACHMENT_LIST_URI, messageUri + "/getAttachments");
messageMap.put(MessageColumns.TO, "account1@mock.com, account2@mock.com");
messageMap.put(MessageColumns.FROM, "fromaccount1@mock.com");
+ if (addReplyTo) {
+ messageMap.put(MessageColumns.REPLY_TO, "replytofromaccount1@mock.com");
+ }
return messageMap;
}