Skip to content

Commit 610ec1d

Browse files
JonasMayerDevalperozturk96
authored andcommitted
change database query to only return uploads for right account
Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
1 parent e9476b9 commit 610ec1d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/src/main/java/com/owncloud/android/datamodel/UploadsStorageManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ public OCUpload[] getCurrentAndPendingUploadsForCurrentAccount() {
569569
}
570570

571571
public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String accountName) {
572-
return getUploads(ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value +
572+
return getUploads("( " + ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value +
573573
" OR " + ProviderTableMeta.UPLOADS_LAST_RESULT +
574574
"==" + UploadResult.DELAYED_FOR_WIFI.getValue() +
575575
" OR " + ProviderTableMeta.UPLOADS_LAST_RESULT +
@@ -578,7 +578,7 @@ public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String ac
578578
"==" + UploadResult.DELAYED_FOR_CHARGING.getValue() +
579579
" OR " + ProviderTableMeta.UPLOADS_LAST_RESULT +
580580
"==" + UploadResult.DELAYED_IN_POWER_SAVE_MODE.getValue() +
581-
" AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?",
581+
" ) AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?",
582582
accountName);
583583
}
584584

@@ -588,7 +588,7 @@ public OCUpload[] getCurrentAndPendingUploadsForAccount(final @NonNull String ac
588588
* If <code>afterId</code> is -1, returns the first page
589589
*/
590590
public List<OCUpload> getCurrentAndPendingUploadsForAccountPageAscById(final long afterId, final @NonNull String accountName) {
591-
final String selection = ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value +
591+
final String selection = "( " + ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_IN_PROGRESS.value +
592592
" OR " + ProviderTableMeta.UPLOADS_LAST_RESULT +
593593
"==" + UploadResult.DELAYED_FOR_WIFI.getValue() +
594594
" OR " + ProviderTableMeta.UPLOADS_LAST_RESULT +
@@ -597,7 +597,7 @@ public List<OCUpload> getCurrentAndPendingUploadsForAccountPageAscById(final lon
597597
"==" + UploadResult.DELAYED_FOR_CHARGING.getValue() +
598598
" OR " + ProviderTableMeta.UPLOADS_LAST_RESULT +
599599
"==" + UploadResult.DELAYED_IN_POWER_SAVE_MODE.getValue() +
600-
" AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?";
600+
" ) AND " + ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "== ?";
601601
return getUploadPage(afterId, false, selection, accountName);
602602
}
603603

0 commit comments

Comments
 (0)