+ mServerStatusText = R.string.auth_unknown_host_title;\r
+ break;\r
+ case INSTANCE_NOT_CONFIGURED:\r
+ mServerStatusText = R.string.auth_not_configured_title;\r
+ break;\r
+ case FILE_NOT_FOUND:\r
+ mServerStatusText = R.string.auth_incorrect_path_title;\r
+ break;\r
+ case OAUTH2_ERROR:\r
+ mServerStatusText = R.string.auth_oauth_error;\r
+ break;\r
+ case OAUTH2_ERROR_ACCESS_DENIED:\r
+ mServerStatusText = R.string.auth_oauth_error_access_denied;\r
+ break;\r
+ case UNHANDLED_HTTP_CODE:\r
+ case UNKNOWN_ERROR:\r
+ mServerStatusText = R.string.auth_unknown_error_title;\r
+ break;\r
+ default:\r
+ 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