+ */\r
+ }\r
+\r
+ /**\r
+ * Called from SslValidatorDialog when a new server certificate was correctly saved.\r
+ */\r
+ public void onSavedCertificate() {\r
+ Fragment fd = getSupportFragmentManager().findFragmentByTag(TAG_SAML_DIALOG);\r
+ if (fd == null) {\r
+ // if SAML dialog is not shown, the SslDialog was shown due to an SSL error in the server check\r
+ checkOcServer();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Called from SslValidatorDialog when a new server certificate could not be saved \r
+ * when the user requested it.\r
+ */\r
+ @Override\r
+ public void onFailedSavingCertificate() {\r
+ showDialog(DIALOG_CERT_NOT_SAVED);\r
+ cancelWebView();\r
+ }\r
+\r
+ @Override\r
+ public void onCancelCertificate() {\r
+ cancelWebView();\r
+ }\r
+\r
+\r
+ public void cancelWebView() {\r
+ Fragment fd = getSupportFragmentManager().findFragmentByTag(TAG_SAML_DIALOG);\r
+ if (fd != null && fd instanceof SherlockDialogFragment) {\r
+ Dialog d = ((SherlockDialogFragment)fd).getDialog();\r
+ if (d != null && d.isShowing()) {\r
+ d.dismiss();\r
+ }\r
+ }\r
+\r
+ }\r
+ \r
+ \r
+ private void doOnResumeAndBound() {\r
+ //Log.wtf(TAG, "registering to listen for operation callbacks" );\r
+ mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler);\r
+ \r
+ if (mGetServerInfoOpId != -1) {\r
+ RemoteOperationResult result = \r
+ mOperationsServiceBinder.getOperationResultIfFinished(mGetServerInfoOpId);\r
+ if (result != null) {\r
+ //Log.wtf(TAG, "found result of operation finished while rotating");\r
+ onGetServerInfoFinish(result);\r
+ }\r
+ }\r
+ }\r
+ \r
+ /** \r
+ * Implements callback methods for service binding. \r
+ */\r
+ private class OperationsServiceConnection implements ServiceConnection {\r
+\r
+ @Override\r
+ public void onServiceConnected(ComponentName component, IBinder service) {\r
+ if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
+ //Log_OC.wtf(TAG, "Operations service connected");\r
+ mOperationsServiceBinder = (OperationsServiceBinder) service;\r
+ \r
+ doOnResumeAndBound();\r
+ \r
+ } else {\r
+ return;\r
+ }\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void onServiceDisconnected(ComponentName component) {\r
+ if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
+ Log_OC.e(TAG, "Operations service crashed");\r
+ mOperationsServiceBinder = null;\r
+ }\r
+ }\r
+ \r