+
+
+ /**
+ * Implements callback methods for service binding. Passed as a parameter to {
+ */
+ private class OperationsServiceConnection implements ServiceConnection {
+
+ @Override
+ public void onServiceConnected(ComponentName component, IBinder service) {
+ if (component.equals(new ComponentName(FileActivity.this, OperationsService.class))) {
+ Log_OC.d(TAG, "Operations service connected");
+ mOperationsServiceBinder = (OperationsServiceBinder) service;
+ mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
+ if (!mOperationsServiceBinder.isPerformingBlockingOperation()) {
+ dismissLoadingDialog();
+ }
+
+ } else {
+ return;
+ }
+ }
+
+
+ @Override
+ public void onServiceDisconnected(ComponentName component) {
+ if (component.equals(new ComponentName(FileActivity.this, OperationsService.class))) {
+ Log_OC.d(TAG, "Operations service disconnected");
+ mOperationsServiceBinder = null;
+ // TODO whatever could be waiting for the service is unbound
+ }
+ }
+ };