Merge I31258a5fbcca1f489c8bf6fb2ed8f3dcad5d2e26 into master

* This is the fix to bug 3008626 that was created in Gingerbread
  and backported to Froyo for an MR release
* The bug prevented validation of EAS w/ Exchange Server 2010 SP1
* For some reason, this fix did not get merged forward into master
  resulting in the bug referenced below

Bug: 3254512
Change-Id: I4e48a8f95b31048f09a036cc16db867da4116f04
This commit is contained in:
Marc Blank 2010-12-03 23:20:02 -08:00
parent 3127277ad5
commit 6b68bc19a6

View File

@ -21,6 +21,8 @@ import com.android.email.mail.Folder;
import com.android.email.mail.MessagingException;
import com.android.email.mail.Store;
import com.android.email.mail.StoreSynchronizer;
import com.android.email.service.EmailServiceProxy;
import com.android.email.service.IEmailService;
import android.content.Context;
import android.os.Bundle;
@ -200,8 +202,13 @@ public class ExchangeStore extends Store {
boolean tssl = uri.getScheme().contains("+trustallcerts");
try {
int port = ssl ? 443 : 80;
return ExchangeUtils.getExchangeService(mContext, null)
.validate("eas", mHost, mUsername, mPassword, port, ssl, tssl);
IEmailService svc = ExchangeUtils.getExchangeService(mContext, null);
// Use a longer timeout for the validate command. Note that the instanceof check
// shouldn't be necessary; we'll do it anyway, just to be safe
if (svc instanceof EmailServiceProxy) {
((EmailServiceProxy)svc).setTimeout(90);
}
return svc.validate("eas", mHost, mUsername, mPassword, port, ssl, tssl);
} catch (RemoteException e) {
throw new MessagingException("Call to validate generated an exception", e);
}