From 99665fe7bfabd0e84e3c1e05bbec5f11fb9a904c Mon Sep 17 00:00:00 2001 From: Martin Hibdon Date: Mon, 20 Oct 2014 16:14:59 -0700 Subject: [PATCH] Disable smart foward/reply b/17720266 When replying to a message, sometimes the wrong message is included in the reply. This seems to be related to smart reply/forward, since it only has ever been known to happen on an Exchange 2013 server. For now, disable smart reply/forward. We do this by making the EmailProvider always zero out the FLAGS_SUPPORTS_SMART_FORWARD bit on the account. This way we can control this feature from the Email app, rather than Exchange. Change-Id: I88bb5f06a1098f9f085592b0a3cf1a01d9eb3fc7 --- .../android/email/provider/EmailProvider.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/provider_src/com/android/email/provider/EmailProvider.java b/provider_src/com/android/email/provider/EmailProvider.java index bc7f374ad..4bd9d4d19 100644 --- a/provider_src/com/android/email/provider/EmailProvider.java +++ b/provider_src/com/android/email/provider/EmailProvider.java @@ -1422,7 +1422,6 @@ public class EmailProvider extends ContentProvider case UPDATED_MESSAGE_ID: case ATTACHMENT_ID: case MAILBOX_ID: - case ACCOUNT_ID: case HOSTAUTH_ID: case CREDENTIAL_ID: case POLICY_ID: @@ -1430,6 +1429,25 @@ public class EmailProvider extends ContentProvider c = db.query(tableName, projection, whereWithId(id, selection), selectionArgs, null, null, sortOrder, limit); break; + case ACCOUNT_ID: + id = uri.getPathSegments().get(1); + // There seems to be an issue with smart forwarding sometimes including the + // quoted text from the wrong message. For now, we just disable it. + final String[] alternateProjection = new String[projection.length]; + for (int i = 0; i < projection.length; i++) { + String column = projection[i]; + if (TextUtils.equals(column, AccountColumns.FLAGS)) { + alternateProjection[i] = AccountColumns.FLAGS + " & ~" + + Account.FLAGS_SUPPORTS_SMART_FORWARD + " AS " + + AccountColumns.FLAGS; + } else { + alternateProjection[i] = projection[i]; + } + } + + c = db.query(tableName, alternateProjection, whereWithId(id, selection), + selectionArgs, null, null, sortOrder, limit); + break; case QUICK_RESPONSE_ID: id = uri.getPathSegments().get(1); c = uiQuickResponseId(projection, id);