+ /** \r
+ * Implements callback methods for service binding. Passed as a parameter to { \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.d(TAG, "Operations service connected");\r
+ mOperationsServiceBinder = (OperationsServiceBinder) service;\r
+ mOperationsServiceBinder.addOperationListener(AuthenticatorActivity.this, mHandler);\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.d(TAG, "Operations service disconnected");\r
+ mOperationsServiceBinder = null;\r
+ // TODO whatever could be waiting for the service is unbound\r
+ }\r
+ }\r
+ \r
+ }\r