Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e1bce22 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Merge branch '310-o-fixqueueingRequest' into 'v1-oreo'

add missing if statement when queueing SyncRequest

See merge request !136
parents 3724fa15 2672484f
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public class SynchronizationService extends Service implements OnRemoteOperation
     */
    public void queueSyncRequest(SyncRequest request) {
        for (SyncWrapper syncWrapper : startedSync.values()) {
            if (syncWrapper.equals(request)) {
            if (syncWrapper.isRunning() && syncWrapper.equals(request)) {
                return;
            }
        }
@@ -128,8 +128,10 @@ public class SynchronizationService extends Service implements OnRemoteOperation
     */
    public void queueSyncRequests(Collection<SyncRequest> requests) {
        for (SyncWrapper syncWrapper : startedSync.values()) {
            if (syncWrapper.isRunning()) {
                requests.removeIf(syncRequest -> syncWrapper.equals(syncRequest));
            }
        }
        final SharedPreferences prefs = getSharedPreferences(FAILED_TRANSFER_PREF, Context.MODE_PRIVATE);
        requests.removeIf(syncRequest -> prefs.getInt(syncRequest.getSyncedFileState().getLocalPath(), 0) >= FAILURE_LIMIT);