+ mServerStatusText = 0;\r
+ mServerStatusIcon = 0;\r
+ }\r
+ }\r
+\r
+\r
+ /**\r
+ * Chooses the right icon and text to show to the user for the received operation result.\r
+ * \r
+ * @param result Result of a remote operation performed in this activity\r
+ */\r
+ private void updateAuthStatusIconAndText(RemoteOperationResult result) {\r
+ mAuthStatusIcon = R.drawable.common_error; // the most common case in the switch below\r
+\r
+ switch (result.getCode()) {\r
+ case OK_SSL:\r
+ mAuthStatusIcon = android.R.drawable.ic_secure;\r
+ mAuthStatusText = R.string.auth_secure_connection;\r
+ break;\r
+\r
+ case OK_NO_SSL:\r
+ case OK:\r
+ if (mHostUrlInput.getText().toString().trim().toLowerCase().startsWith("http://") ) {\r
+ mAuthStatusText = R.string.auth_connection_established;\r
+ mAuthStatusIcon = R.drawable.ic_ok;\r
+ } else {\r
+ mAuthStatusText = R.string.auth_nossl_plain_ok_title;\r
+ mAuthStatusIcon = android.R.drawable.ic_partial_secure;\r
+ }\r
+ break;\r
+\r
+ case NO_NETWORK_CONNECTION:\r
+ mAuthStatusIcon = R.drawable.no_network;\r
+ mAuthStatusText = R.string.auth_no_net_conn_title;\r
+ break;\r
+\r
+ case SSL_RECOVERABLE_PEER_UNVERIFIED:\r
+ mAuthStatusText = R.string.auth_ssl_unverified_server_title;\r
+ break;\r
+ case BAD_OC_VERSION:\r
+ mAuthStatusText = R.string.auth_bad_oc_version_title;\r
+ break;\r
+ case WRONG_CONNECTION:\r
+ mAuthStatusText = R.string.auth_wrong_connection_title;\r