am 3d26769: Merge branch \'readonly-p4-donut\' into donut

Merge commit '3d267690a3295e2d1e6df8fb77cb92625f010480'

* commit '3d267690a3295e2d1e6df8fb77cb92625f010480':
  AI 148457: Allow exchange accounts to be set up without an empty domain
This commit is contained in:
Andy Stadler 2009-05-07 11:02:13 -07:00 committed by The Android Open Source Project
commit 00e85ad8ee
2 changed files with 9 additions and 6 deletions

View File

@ -191,8 +191,7 @@ public class AccountSetupExchange extends Activity implements OnClickListener {
private void validateFields() { private void validateFields() {
boolean enabled = Utility.requiredFieldValid(mUsernameView) boolean enabled = Utility.requiredFieldValid(mUsernameView)
&& Utility.requiredFieldValid(mPasswordView) && Utility.requiredFieldValid(mPasswordView)
&& Utility.requiredFieldValid(mServerView) && Utility.requiredFieldValid(mServerView);
&& Utility.requiredFieldValid(mDomainView);
if (enabled) { if (enabled) {
try { try {
URI uri = getUri(); URI uri = getUri();
@ -229,7 +228,11 @@ public class AccountSetupExchange extends Activity implements OnClickListener {
String userInfo = mUsernameView.getText().toString().trim() + ":" + String userInfo = mUsernameView.getText().toString().trim() + ":" +
mPasswordView.getText().toString().trim(); mPasswordView.getText().toString().trim();
String host = mServerView.getText().toString().trim(); String host = mServerView.getText().toString().trim();
String path = "/" + mDomainView.getText().toString().trim(); String domain = mDomainView.getText().toString().trim();
String path = null;
if (domain.length() > 0) {
path = "/" + domain;
}
URI uri = new URI( URI uri = new URI(
scheme, scheme,

View File

@ -115,13 +115,13 @@ public class AccountSetupExchangeTests extends
} }
/** /**
* No EAS domain is not OK - not enabled * No EAS domain is OK - enabled
*/ */
public void testBadUriNoDomain() { public void testBadUriNoDomain() {
Intent i = getTestIntent("eas://user:password@server.com"); Intent i = getTestIntent("eas://user:password@server.com");
setActivityIntent(i); setActivityIntent(i);
getActivityAndFields(); getActivityAndFields();
assertFalse(mNextButton.isEnabled()); assertTrue(mNextButton.isEnabled());
} }
/** /**
@ -147,7 +147,7 @@ public class AccountSetupExchangeTests extends
assertTrue(mNextButton.isEnabled()); assertTrue(mNextButton.isEnabled());
mDomainView.setText(" "); mDomainView.setText(" ");
assertFalse(mNextButton.isEnabled()); assertTrue(mNextButton.isEnabled());
mDomainView.setText("do main"); mDomainView.setText("do main");
assertFalse(mNextButton.isEnabled()); assertFalse(mNextButton.isEnabled());