From 3bdba62f5804b91a95a5ec48c1c61342c5703587 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 20 Oct 2010 13:03:33 -0700 Subject: [PATCH] Don't duplicate attachments when saving drafts Bug: 3070196 Change-Id: Ic9dffe57cdc81615e07b1c593fc71085e1281718 --- src/com/android/email/activity/MessageCompose.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index 9de1c06c1..c97bf823c 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -60,7 +60,6 @@ import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; -import android.view.Window; import android.webkit.WebView; import android.widget.Button; import android.widget.EditText; @@ -873,7 +872,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus // this attachment is new so save it to DB. attachment.mMessageKey = mDraft.mId; attachment.save(MessageCompose.this); - } else { + } else if (attachment.mMessageKey != mDraft.mId) { // We clone the attachment and save it again; otherwise, it will // continue to point to the source message. From this point forward, // the attachments will be independent of the original message in the