From 0e6254223a0bf6ce06447dedc5e14d77cf8aa3c0 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Thu, 4 Nov 2010 16:27:44 -0700 Subject: [PATCH] Reverse FLAG_INCLUDE_QUOTED_TEXT To make it compatible with old databases. (Follow-up to Ie7bcca23) Bug 3162967 Change-Id: Ie3bbb5089900bb9dbd0834adbdd466fa009245f9 --- src/com/android/email/activity/MessageCompose.java | 7 +++---- src/com/android/email/provider/EmailContent.java | 11 +++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index 49e9157dc..b5d3d21ca 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -559,7 +559,6 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus mAddressAdapterBcc = new EmailAddressAdapter(this); } - // TODO: is there any way to unify this with MessageView.LoadMessageTask? private class LoadMessageTask extends AsyncTask { private final long mMessageId; @@ -807,9 +806,9 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus } if (includeQuotedText()) { - message.mFlags |= Message.FLAG_INCLUDE_QUOTED_TEXT; + message.mFlags &= ~Message.FLAG_NOT_INCLUDE_QUOTED_TEXT; } else { - message.mFlags &= ~Message.FLAG_INCLUDE_QUOTED_TEXT; + message.mFlags |= Message.FLAG_NOT_INCLUDE_QUOTED_TEXT; if (sending) { // If we are about to send a message, and not including the original message, // clear the related field. @@ -1485,7 +1484,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus */ if (ACTION_EDIT_DRAFT.equals(mAction)) { displayQuotedText(message.mTextReply, message.mHtmlReply); - setIncludeQuotedText((mDraft.mFlags & Message.FLAG_INCLUDE_QUOTED_TEXT) != 0); + setIncludeQuotedText((mDraft.mFlags & Message.FLAG_NOT_INCLUDE_QUOTED_TEXT) == 0); } } diff --git a/src/com/android/email/provider/EmailContent.java b/src/com/android/email/provider/EmailContent.java index ff1a9c72e..6170126d1 100644 --- a/src/com/android/email/provider/EmailContent.java +++ b/src/com/android/email/provider/EmailContent.java @@ -621,10 +621,13 @@ public abstract class EmailContent { // 8 general purpose flags (bits) that may be used at the discretion of the sync adapter public static final int FLAG_SYNC_ADAPTER_SHIFT = 9; public static final int FLAG_SYNC_ADAPTER_MASK = 255 << FLAG_SYNC_ADAPTER_SHIFT; - // Bit used in mFlags indicating that the outgoing message should include quoted original - // message. - public static final int FLAG_INCLUDE_QUOTED_TEXT_SHIFT = 17; - public static final int FLAG_INCLUDE_QUOTED_TEXT = 1 << FLAG_INCLUDE_QUOTED_TEXT_SHIFT; + /** + * Bit used in mFlags indicating that the outgoing message should *not* include quoted + * original message. ("Not", in order to keep compatibility with old databases) + */ + public static final int FLAG_NOT_INCLUDE_QUOTED_TEXT_SHIFT = 17; + public static final int FLAG_NOT_INCLUDE_QUOTED_TEXT + = 1 << FLAG_NOT_INCLUDE_QUOTED_TEXT_SHIFT; public Message() { mBaseUri = CONTENT_URI;