From 6632f8486feb4bada33c5a385c2a75d33572ec97 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Sun, 1 Oct 2017 16:04:45 +0200 Subject: [PATCH] trigger delayed closing of changesets also on manual upload (if anything was uploaded) --- .../westnordost/streetcomplete/data/QuestAutoSyncer.java | 7 ------- .../data/osm/upload/AOsmQuestChangesUpload.java | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/QuestAutoSyncer.java b/app/src/main/java/de/westnordost/streetcomplete/data/QuestAutoSyncer.java index 9f01e1ca3a..166edda9a3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/QuestAutoSyncer.java +++ b/app/src/main/java/de/westnordost/streetcomplete/data/QuestAutoSyncer.java @@ -131,13 +131,6 @@ public void triggerAutoUpload() if(!isAllowedByPreference()) return; if(!isConnected) return; questController.upload(); - triggerDelayedClosingOfChangesets(); - } - - private void triggerDelayedClosingOfChangesets() - { - ChangesetAutoCloserJob.scheduleJob(); - } private boolean updateConnectionState() diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osm/upload/AOsmQuestChangesUpload.java b/app/src/main/java/de/westnordost/streetcomplete/data/osm/upload/AOsmQuestChangesUpload.java index 3a78ffed40..67182e21f2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/osm/upload/AOsmQuestChangesUpload.java +++ b/app/src/main/java/de/westnordost/streetcomplete/data/osm/upload/AOsmQuestChangesUpload.java @@ -132,6 +132,12 @@ public synchronized void upload(AtomicBoolean cancelState) } closeOpenChangesets(); + + if(commits > 0) + { + // changesets are closed delayed after X minutes of inactivity + ChangesetAutoCloserJob.scheduleJob(); + } } private void cleanUp()