@@ -263,11 +263,10 @@ private int updateUploadInternal(Cursor c, UploadStatus status, UploadResult res
263
263
* @param localPath path of the file to upload in the device storage
264
264
* @return 1 if file status was updated, else 0.
265
265
*/
266
- private int updateUploadStatus (long id , UploadStatus status , UploadResult result , String remotePath ,
266
+ private void updateUploadStatus (long id , UploadStatus status , UploadResult result , String remotePath ,
267
267
String localPath ) {
268
268
//Log_OC.v(TAG, "Updating "+filepath+" with uploadStatus="+status +" and result="+result);
269
269
270
- int returnValue = 0 ;
271
270
Cursor c = getDB ().query (
272
271
ProviderTableMeta .CONTENT_URI_UPLOADS ,
273
272
null ,
@@ -281,14 +280,13 @@ private int updateUploadStatus(long id, UploadStatus status, UploadResult result
281
280
Log_OC .e (TAG , c .getCount () + " items for id=" + id
282
281
+ " available in UploadDb. Expected 1. Failed to update upload db." );
283
282
} else {
284
- returnValue = updateUploadInternal (c , status , result , remotePath , localPath );
283
+ updateUploadInternal (c , status , result , remotePath , localPath );
285
284
}
286
285
c .close ();
287
286
} else {
288
287
Log_OC .e (TAG , "Cursor is null" );
289
288
}
290
289
291
- return returnValue ;
292
290
}
293
291
294
292
/**
@@ -733,7 +731,7 @@ private ContentResolver getDB() {
733
731
return contentResolver ;
734
732
}
735
733
736
- public long clearFailedButNotDelayedUploads () {
734
+ public void clearFailedButNotDelayedUploads () {
737
735
User user = currentAccountProvider .getUser ();
738
736
final long deleted = getDB ().delete (
739
737
ProviderTableMeta .CONTENT_URI_UPLOADS ,
@@ -753,7 +751,6 @@ public long clearFailedButNotDelayedUploads() {
753
751
if (deleted > 0 ) {
754
752
notifyObserversNow ();
755
753
}
756
- return deleted ;
757
754
}
758
755
759
756
public void clearCancelledUploadsForCurrentAccount () {
@@ -770,7 +767,7 @@ public void clearCancelledUploadsForCurrentAccount() {
770
767
}
771
768
}
772
769
773
- public long clearSuccessfulUploads () {
770
+ public void clearSuccessfulUploads () {
774
771
User user = currentAccountProvider .getUser ();
775
772
final long deleted = getDB ().delete (
776
773
ProviderTableMeta .CONTENT_URI_UPLOADS ,
@@ -782,7 +779,6 @@ public long clearSuccessfulUploads() {
782
779
if (deleted > 0 ) {
783
780
notifyObserversNow ();
784
781
}
785
- return deleted ;
786
782
}
787
783
788
784
/**
@@ -848,12 +844,7 @@ public void updateDatabaseUploadStart(UploadFileOperation upload) {
848
844
? upload .getStoragePath () : null ;
849
845
850
846
updateUploadStatus (
851
- upload .getOCUploadId (),
852
- UploadStatus .UPLOAD_IN_PROGRESS ,
853
- UploadResult .UNKNOWN ,
854
- upload .getRemotePath (),
855
- localPath
856
- );
847
+ upload .getOCUploadId ());
857
848
}
858
849
859
850
/**
@@ -890,9 +881,9 @@ public int failInProgressUploads(UploadResult fail) {
890
881
}
891
882
892
883
@ VisibleForTesting
893
- public int removeAllUploads () {
884
+ public void removeAllUploads () {
894
885
Log_OC .v (TAG , "Delete all uploads!" );
895
- return getDB ().delete (
886
+ getDB ().delete (
896
887
ProviderTableMeta .CONTENT_URI_UPLOADS ,
897
888
"" ,
898
889
new String []{});
0 commit comments