@Override
 public Bundle autoDiscover(String userName, String password) throws RemoteException {
   HostAuth hostAuth = new HostAuth();
   hostAuth.mLogin = userName;
   hostAuth.mPassword = password;
   hostAuth.mFlags = HostAuth.FLAG_AUTHENTICATE | HostAuth.FLAG_SSL;
   hostAuth.mPort = 443;
   return new EasSyncService().tryAutodiscover(ExchangeService.this, hostAuth);
 }
Exemplo n.º 2
0
  public void testTryAutodiscover() throws RemoteException, IOException {
    String userName = "******";
    String password = "******";

    EasSyncService service = new EasSyncService();
    Bundle bundle1 = service.tryAutodiscover(userName, password);
    Bundle bundle2 = new Bundle();
    bundle2.putInt(EmailServiceProxy.AUTO_DISCOVER_BUNDLE_ERROR_CODE, MessagingException.NO_ERROR);
    HostAuth hostAuth = new HostAuth();
    hostAuth.mAddress = "google.com";
    hostAuth.mLogin = userName;
    hostAuth.mPassword = password;
    hostAuth.mPort = 443;
    hostAuth.mProtocol = "eas";
    hostAuth.mFlags = HostAuth.FLAG_SSL | HostAuth.FLAG_AUTHENTICATE;
    bundle2.putParcelable(EmailServiceProxy.AUTO_DISCOVER_BUNDLE_HOST_AUTH, hostAuth);
    assertEquals(bundle2.toString(), bundle1.toString());
  }