From 7a59191bf1089ec2b89128406637c2094077cbce Mon Sep 17 00:00:00 2001 From: Mihai Preda Date: Wed, 23 Sep 2009 16:50:31 +0200 Subject: [PATCH] Fix loading the quoted text when editing draft. Bug 2140036. Only load the reply fields for an edit-draft situation. Change-Id: I851e3851ab595a0a2e6829a3bf3845ae576f1ba7 --- .../android/exchange/adapter/EmailSyncAdapter.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/com/android/exchange/adapter/EmailSyncAdapter.java b/src/com/android/exchange/adapter/EmailSyncAdapter.java index 71eb7a76c..ee4aae56a 100644 --- a/src/com/android/exchange/adapter/EmailSyncAdapter.java +++ b/src/com/android/exchange/adapter/EmailSyncAdapter.java @@ -116,17 +116,11 @@ public class EmailSyncAdapter extends AbstractSyncAdapter { msg.mTo = Address.pack(Address.parse(getValue())); break; case Tags.EMAIL_FROM: - String from = getValue(); - String sender = from; - int q = from.indexOf('\"'); - if (q >= 0) { - int qq = from.indexOf('\"', q + 1); - if (qq > 0) { - sender = from.substring(q + 1, qq); - } + Address[] froms = Address.parse(getValue()); + if (froms != null && froms.length > 0) { + msg.mDisplayName = froms[0].toFriendly(); } - msg.mDisplayName = sender; - msg.mFrom = Address.pack(Address.parse(from)); + msg.mFrom = Address.pack(froms); break; case Tags.EMAIL_CC: msg.mCc = Address.pack(Address.parse(getValue()));