diff options
author | Martin Hibdon <mhibdon@google.com> | 2014-07-02 14:00:36 -0700 |
---|---|---|
committer | Martin Hibdon <mhibdon@google.com> | 2014-07-07 14:42:23 -0700 |
commit | d793a08771c02d20c81acbedfc44d601d07d1c4f (patch) | |
tree | 250f226e67f83bbe7039904dfe7eb4b3168a3914 /src | |
parent | 0f40c9f19872a87d946d5deeaf19b8121ad07f64 (diff) | |
download | android_packages_apps_Exchange-d793a08771c02d20c81acbedfc44d601d07d1c4f.tar.gz android_packages_apps_Exchange-d793a08771c02d20c81acbedfc44d601d07d1c4f.tar.bz2 android_packages_apps_Exchange-d793a08771c02d20c81acbedfc44d601d07d1c4f.zip |
Add communication class for HostAuth
We want a separate class for communicating HostAuth objects
to and from IEmailService. The issue is that the HostAuth object
was being used for both to and from the database, and to and from
IEmailService. This is dangerous because The Email app may change
out of band with the Exchange app, and may need to change the
format of HostAuth. This bit us before when adding OAuth.
Now communication to IEmailService is done using HostAuthCompat.
Change-Id: I883aed9893f20f316b28d1838ad804bf4c7e7d3a
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/exchange/eas/EasAutoDiscover.java | 4 | ||||
-rw-r--r-- | src/com/android/exchange/service/EasService.java | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/exchange/eas/EasAutoDiscover.java b/src/com/android/exchange/eas/EasAutoDiscover.java index fd300876..feb38663 100644 --- a/src/com/android/exchange/eas/EasAutoDiscover.java +++ b/src/com/android/exchange/eas/EasAutoDiscover.java @@ -8,6 +8,7 @@ import android.util.Xml; import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.HostAuth; import com.android.emailcommon.service.EmailServiceProxy; +import com.android.emailcommon.service.HostAuthCompat; import com.android.exchange.CommandStatusException; import com.android.exchange.Eas; import com.android.exchange.EasResponse; @@ -179,8 +180,9 @@ public class EasAutoDiscover extends EasOperation { public Bundle getResultBundle() { final Bundle bundle = new Bundle(2); + final HostAuthCompat hostAuthCompat = new HostAuthCompat(mHostAuth); bundle.putParcelable(EmailServiceProxy.AUTO_DISCOVER_BUNDLE_HOST_AUTH, - mHostAuth); + hostAuthCompat); bundle.putInt(EmailServiceProxy.AUTO_DISCOVER_BUNDLE_ERROR_CODE, RESULT_OK); return bundle; diff --git a/src/com/android/exchange/service/EasService.java b/src/com/android/exchange/service/EasService.java index 41172798..b47fb3c3 100644 --- a/src/com/android/exchange/service/EasService.java +++ b/src/com/android/exchange/service/EasService.java @@ -18,7 +18,6 @@ package com.android.exchange.service; import android.app.Service; import android.content.ContentResolver; -import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.database.Cursor; @@ -32,29 +31,25 @@ import android.text.TextUtils; import com.android.emailcommon.TempDirectory; import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.EmailContent; -import com.android.emailcommon.provider.EmailContent.Message; import com.android.emailcommon.provider.HostAuth; import com.android.emailcommon.provider.Mailbox; import com.android.emailcommon.service.EmailServiceProxy; import com.android.emailcommon.service.EmailServiceStatus; +import com.android.emailcommon.service.HostAuthCompat; import com.android.emailcommon.service.IEmailService; import com.android.emailcommon.service.IEmailServiceCallback; import com.android.emailcommon.service.SearchParams; import com.android.emailcommon.service.ServiceProxy; -import com.android.emailcommon.utility.Utility; import com.android.exchange.Eas; import com.android.exchange.eas.EasAutoDiscover; import com.android.exchange.eas.EasFolderSync; import com.android.exchange.eas.EasFullSyncOperation; import com.android.exchange.eas.EasLoadAttachment; import com.android.exchange.eas.EasOperation; -import com.android.exchange.eas.EasOutboxSync; import com.android.exchange.eas.EasSearch; import com.android.exchange.eas.EasSearchGal; import com.android.exchange.eas.EasSendMeetingResponse; -import com.android.exchange.eas.EasSyncBase; import com.android.exchange.provider.GalResult; -import com.android.mail.providers.UIProvider; import com.android.mail.utils.LogUtils; import java.util.HashSet; @@ -122,7 +117,8 @@ public class EasService extends Service { } @Override - public Bundle validate(final HostAuth hostAuth) { + public Bundle validate(final HostAuthCompat hostAuthCom) { + final HostAuth hostAuth = hostAuthCom.toHostAuth(); final EasFolderSync operation = new EasFolderSync(EasService.this, hostAuth); doOperation(operation, "IEmailService.validate"); return operation.getValidationResult(); |