From 7c87bfc33aaf94e50e4be9ff0b838e4b3a3812f4 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Tue, 1 Mar 2011 14:46:38 -0800 Subject: [PATCH] Change "appendQuotedText" to "useSmartReply" in Rfc822Output Slight API change to make it more clear what the method parameter is for. Also add some additonal test conditions to the Rfc822Output tests. Reapply changes in CL https://android-git.corp.google.com/g/#change,99090 Change-Id: I7a48c9544e48cbdf44b14f4b1f8d92fe01f7861e --- .../android/emailcommon/internet/Rfc822Output.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java b/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java index 9a3b017b9..7382d30b2 100644 --- a/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java +++ b/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java @@ -62,7 +62,7 @@ public class Rfc822Output { Attachment.FLAG_SMART_FORWARD + ")=0"; /*package*/ static String buildBodyText(Context context, Message message, - boolean appendQuotedText) { + boolean useSmartReply) { Body body = Body.restoreBodyWithMessageId(context, message.mId); if (body == null) { return null; @@ -77,8 +77,8 @@ public class Rfc822Output { String intro = body.mIntroText == null ? "" : body.mIntroText; text += intro; } - if (!appendQuotedText) { - // appendQuotedText is set to false for use by SmartReply/SmartForward in EAS. + if (useSmartReply) { + // useSmartReply is set to true for use by SmartReply/SmartForward in EAS. // SmartForward doesn't put a break between the original and new text, so we add an LF if (isForward) { text += "\n"; @@ -112,12 +112,12 @@ public class Rfc822Output { * @param context system context for accessing the provider * @param messageId the message to write out * @param out the output stream to write the message to - * @param appendQuotedText whether or not to append quoted text if this is a reply/forward + * @param useSmartReply whether or not quoted text is appended to a reply/forward * * TODO alternative parts (e.g. text+html) are not supported here. */ public static void writeTo(Context context, long messageId, OutputStream out, - boolean appendQuotedText, boolean sendBcc) throws IOException, MessagingException { + boolean useSmartReply, boolean sendBcc) throws IOException, MessagingException { Message message = Message.restoreMessageWithId(context, messageId); if (message == null) { // throw something? @@ -149,7 +149,7 @@ public class Rfc822Output { writeHeader(writer, "MIME-Version", "1.0"); // Analyze message and determine if we have multiparts - String text = buildBodyText(context, message, appendQuotedText); + String text = buildBodyText(context, message, useSmartReply); Uri uri = ContentUris.withAppendedId(Attachment.MESSAGE_ID_URI, messageId); Cursor attachmentsCursor = context.getContentResolver().query(uri,