+
+
+ /**
+ * Class waiting for broadcast events from the {@link OperationsService}.
+ *
+ * Updates the list of files when a get for shares is finished; at this moment the refresh of shares is the only
+ * operation performed in {@link OperationsService}.
+ *
+ * In the future will handle the progress or finalization of all the operations performed in {@link OperationsService},
+ * probably all the operations associated to the app model.
+ */
+ private class OperationsServiceReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (OperationsService.ACTION_OPERATION_ADDED.equals(intent.getAction())) {
+
+ } else if (OperationsService.ACTION_OPERATION_FINISHED.equals(intent.getAction())) {
+ mRefreshSharesInProgress = false;
+
+ Account account = intent.getParcelableExtra(OperationsService.EXTRA_ACCOUNT);
+ RemoteOperationResult getSharesResult = (RemoteOperationResult)intent.getSerializableExtra(OperationsService.EXTRA_RESULT);
+ if (getAccount() != null && account.name.equals(getAccount().name)
+ && mStorageManager != null
+ ) {
+ refeshListOfFilesFragment();
+ }
+ if ((getSharesResult != null) &&
+ RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(getSharesResult.getCode())) {
+ mLastSslUntrustedServerResult = getSharesResult;
+ showDialog(DIALOG_SSL_VALIDATOR);
+ }
+
+ setSupportProgressBarIndeterminateVisibility(mRefreshSharesInProgress || mSyncInProgress);
+ }
+
+ }
+
+ }