}
if (mFilesForDirectDownload.isEmpty()) {
- // Send a broadcast message for notifying UI update
- Intent uiUpdate = new Intent(FileDownloader.getDownloadFinishMessage());
- uiUpdate.putExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, result.isSuccess());
- uiUpdate.putExtra(FileDownloader.ACCOUNT_NAME, mAccount.name);
- uiUpdate.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mRemotePath);
- uiUpdate.putExtra(FileDownloader.EXTRA_FILE_PATH, mLocalFolder.getRemotePath());
- mContext.sendStickyBroadcast(uiUpdate);
+ sendBroadcastForNotifyingUIUpdate(result.isSuccess());
}
}
} catch (OperationCancelledException e) {
Log_OC.e(TAG, "Checked " + mAccount.name + mRemotePath + " : " +
result.getLogMessage());
}
+
+ sendBroadcastForNotifyingUIUpdate(result.isSuccess());
}
return result;
}
}
+ private void sendBroadcastForNotifyingUIUpdate(boolean result) {
+ // Send a broadcast message for notifying UI update
+ Intent uiUpdate = new Intent(FileDownloader.getDownloadFinishMessage());
+ uiUpdate.putExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, result);
+ uiUpdate.putExtra(FileDownloader.ACCOUNT_NAME, mAccount.name);
+ uiUpdate.putExtra(FileDownloader.EXTRA_REMOTE_PATH, mRemotePath);
+ uiUpdate.putExtra(FileDownloader.EXTRA_FILE_PATH, mLocalFolder.getRemotePath());
+ mContext.sendStickyBroadcast(uiUpdate);
+ }
+
/**
* Cancel operation