From 8b90caa497d6d345974195e0645b25557a05a784 Mon Sep 17 00:00:00 2001 From: Martin Hibdon Date: Tue, 21 Oct 2014 11:44:09 -0700 Subject: If an account does not support smart forward, then it doesn't do smart reply either b/17720266 It turns out that if an account's FLAG_SUPPORTS_SMART_FORWARD was unset, that did not prevent it from attempting to smart reply. We need to be able to disable all types of smart sending, so I'm making FLAG_SUPPORTS_SMART_FORWARD also control ability to smart reply. In a later CL, we should probably make separate flags for these two capabilities. Also, add some logging for the case where we attempt a smart send, and the server rejects it. This should be an uncommon case. Change-Id: I0d6a54b5f7aa796b72c9eb133a84cd4099fbadcb --- src/com/android/exchange/eas/EasFullSyncOperation.java | 2 ++ src/com/android/exchange/eas/EasOutboxSync.java | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/android/exchange/eas/EasFullSyncOperation.java b/src/com/android/exchange/eas/EasFullSyncOperation.java index 9472e4f3..ba81466e 100644 --- a/src/com/android/exchange/eas/EasFullSyncOperation.java +++ b/src/com/android/exchange/eas/EasFullSyncOperation.java @@ -307,6 +307,8 @@ public class EasFullSyncOperation extends EasOperation { if (result == EasOutboxSync.RESULT_ITEM_NOT_FOUND) { // This can happen if we are using smartReply, and the message we are referring // to has disappeared from the server. Try again with smartReply disabled. + // This should be a legitimate, but unusual case. Log a warning. + LogUtils.w(TAG, "WARNING: EasOutboxSync falling back from smartReply"); op = new EasOutboxSync(mContext, mAccount, message, false); result = op.performOperation(); } diff --git a/src/com/android/exchange/eas/EasOutboxSync.java b/src/com/android/exchange/eas/EasOutboxSync.java index 049fd19d..6f85f771 100644 --- a/src/com/android/exchange/eas/EasOutboxSync.java +++ b/src/com/android/exchange/eas/EasOutboxSync.java @@ -348,8 +348,10 @@ public class EasOutboxSync extends EasOperation { if (reply && forward) { return null; } - // If we don't support SmartForward and it's a forward, then don't proceed. - if (forward && (account.mFlags & Account.FLAGS_SUPPORTS_SMART_FORWARD) == 0) { + // If we don't support SmartForward, then don't proceed. + // TODO: For now, we assume that if we do not support Smart Forward, we also don't + // support Smart Reply. At some point, perhaps these should be separate flags. + if ((account.mFlags & Account.FLAGS_SUPPORTS_SMART_FORWARD) == 0) { return null; } -- cgit v1.2.3