From 21d077e60b43072a610a01f6d4e4c6a29aa006e1 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 10 Dec 2009 14:04:24 -0800 Subject: [PATCH] Use correct EAS version in Outbox (fixes #2319892) DO NOT MERGE * We inadvertently failed to set the EAS version in EasOutboxService, so the default of 2.5 is used * This works, but SmartReply/SmartForward were enhanced in 12.0 and we aren't taking advantage of those changes * The fix is to set the version using common code Change-Id: Ife6689fa9934da42d98a48df74fca90ba6d1718c --- src/com/android/exchange/EasSyncService.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index a18cf8b11..9ac3257de 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -1075,11 +1075,12 @@ public class EasSyncService extends AbstractSyncService { mExitStatus = EXIT_DONE; } - protected void setupService() { + protected boolean setupService() { // Make sure account and mailbox are always the latest from the database mAccount = Account.restoreAccountWithId(mContext, mAccount.mId); + if (mAccount == null) return false; mMailbox = Mailbox.restoreMailboxWithId(mContext, mMailbox.mId); - + if (mMailbox == null) return false; mThread = Thread.currentThread(); android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); TAG = mThread.getName(); @@ -1088,13 +1089,20 @@ public class EasSyncService extends AbstractSyncService { mHostAddress = ha.mAddress; mUserName = ha.mLogin; mPassword = ha.mPassword; + + // Set up our protocol version + mProtocolVersion = mAccount.mProtocolVersion; + if (mProtocolVersion != null) { + mProtocolVersionDouble = Double.parseDouble(mProtocolVersion); + } + return true; } /* (non-Javadoc) * @see java.lang.Runnable#run() */ public void run() { - setupService(); + if (!setupService()) return; try { SyncManager.callback().syncMailboxStatus(mMailboxId, EmailServiceStatus.IN_PROGRESS, 0); @@ -1111,8 +1119,6 @@ public class EasSyncService extends AbstractSyncService { runAccountMailbox(); } else { AbstractSyncAdapter target; - mProtocolVersion = mAccount.mProtocolVersion; - mProtocolVersionDouble = Double.parseDouble(mProtocolVersion); if (mMailbox.mType == Mailbox.TYPE_CONTACTS) { target = new ContactsSyncAdapter(mMailbox, this); } else {