Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public class FileUploader extends Service
//since there can be only one instance of an Android service, there also just one db connection.
private UploadsStorageManager mUploadsStorageManager = null;

private IndexedForest<UploadFileOperation> mPendingUploads = new IndexedForest<UploadFileOperation>();
private IndexedForest<UploadFileOperation> mPendingUploads = new IndexedForest<>();

private LocalBroadcastManager mLocalBroadcastManager;

Expand Down Expand Up @@ -565,7 +565,7 @@ public class FileUploaderBinder extends Binder implements OnDatatransferProgress
* {@link FileUploaderBinder} instance
*/
private Map<String, WeakReference<OnDatatransferProgressListener>> mBoundListeners =
new HashMap<String, WeakReference<OnDatatransferProgressListener>>();
new HashMap<>();

/**
* Cancels a pending or current upload of a remote file.
Expand Down Expand Up @@ -873,7 +873,7 @@ public void uploadFile(String uploadKey) {
);
}

if (!uploadResult.isSuccess()) {
if (uploadResult != null && !uploadResult.isSuccess()) {
TransferRequester requester = new TransferRequester();
int jobId = mPendingUploads.buildKey(
mCurrentAccount.name,
Expand Down Expand Up @@ -917,10 +917,11 @@ public void uploadFile(String uploadKey) {
Timber.v(stringToLog);
}

mUploadsStorageManager.updateDatabaseUploadResult(uploadResult, mCurrentUpload);

/// notify result
notifyUploadResult(mCurrentUpload, uploadResult);
if (uploadResult != null) {
mUploadsStorageManager.updateDatabaseUploadResult(uploadResult, mCurrentUpload);
/// notify result
notifyUploadResult(mCurrentUpload, uploadResult);
}

sendBroadcastUploadFinished(mCurrentUpload, uploadResult, removeResult.second);
}
Expand Down