Merge commit '29935abb1cbb64ffa232daefeaae7ecc4541722b' into eclair-mr2-plus-aosp * commit '29935abb1cbb64ffa232daefeaae7ecc4541722b': Fix #2251837; better response when provisioning is required.
This commit is contained in:
commit
703edadd61
@ -483,6 +483,8 @@
|
||||
<string name="account_setup_failed_security">Unable to open connection to server due to security error.</string>
|
||||
<!-- Additional diagnostic text when server connection failed due to io error (connection) -->
|
||||
<string name="account_setup_failed_ioerror">Unable to open connection to server.</string>
|
||||
<!-- Additional diagnostic text when validation vailed due to required provisioning not being supported -->
|
||||
<string name="account_setup_failed_security_policies_required">Security policies not supported. Please contact your IT department.</string>
|
||||
|
||||
<!-- "Setup could not finish" dialog action button -->
|
||||
<string name="account_setup_failed_dlg_edit_details_action">Edit details</string>
|
||||
|
@ -166,6 +166,9 @@ public class AccountSetupCheckSettings extends Activity implements OnClickListen
|
||||
case MessagingException.AUTH_REQUIRED:
|
||||
id = R.string.account_setup_failed_auth_required;
|
||||
break;
|
||||
case MessagingException.SECURITY_POLICIES_REQUIRED:
|
||||
id = R.string.account_setup_failed_security_policies_required;
|
||||
break;
|
||||
case MessagingException.GENERAL_SECURITY:
|
||||
id = R.string.account_setup_failed_security;
|
||||
break;
|
||||
|
@ -43,6 +43,8 @@ public class MessagingException extends Exception {
|
||||
public static final int AUTHENTICATION_FAILED = 5;
|
||||
/** Attempt to create duplicate account */
|
||||
public static final int DUPLICATE_ACCOUNT = 6;
|
||||
/** Required security policies not supported */
|
||||
public static final int SECURITY_POLICIES_REQUIRED = 7;
|
||||
|
||||
protected int mExceptionType;
|
||||
|
||||
|
@ -214,6 +214,17 @@ public class EasSyncService extends AbstractSyncService {
|
||||
userLog("OPTIONS response without commands or versions; reporting I/O error");
|
||||
throw new MessagingException(MessagingException.IOERROR);
|
||||
}
|
||||
|
||||
// Run second test here for provisioning failures...
|
||||
Serializer s = new Serializer();
|
||||
userLog("Try folder sync");
|
||||
s.start(Tags.FOLDER_FOLDER_SYNC).start(Tags.FOLDER_SYNC_KEY).text("0")
|
||||
.end().end().done();
|
||||
resp = svc.sendHttpClientPost("FolderSync", s.toByteArray());
|
||||
code = resp.getStatusLine().getStatusCode();
|
||||
if (code == HttpStatus.SC_FORBIDDEN) {
|
||||
throw new MessagingException(MessagingException.SECURITY_POLICIES_REQUIRED);
|
||||
}
|
||||
userLog("Validation successful");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user