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
diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java
index a18cf8b..9ac3257 100644
--- a/src/com/android/exchange/EasSyncService.java
+++ b/src/com/android/exchange/EasSyncService.java
@@ -1075,11 +1075,12 @@
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 @@
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 @@
runAccountMailbox();
} else {
AbstractSyncAdapter target;
- mProtocolVersion = mAccount.mProtocolVersion;
- mProtocolVersionDouble = Double.parseDouble(mProtocolVersion);
if (mMailbox.mType == Mailbox.TYPE_CONTACTS) {
target = new ContactsSyncAdapter(mMailbox, this);
} else {