From db5d79fa2defba0bde69cbe0182026b5ccb18522 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Tue, 19 Sep 2017 16:02:38 +0300 Subject: [PATCH 1/4] Fixed issue #4447 --- .../osmand/plus/download/ui/LocalIndexesFragment.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index b7f1900df3..539b22ccde 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -55,6 +55,8 @@ import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.IndexItem; import net.osmand.plus.helpers.FileNameTranslationHelper; +import net.osmand.plus.inapp.InAppHelper; +import net.osmand.plus.resources.IncrementalChangesManager; import net.osmand.util.Algorithms; import java.io.File; @@ -465,6 +467,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement if (operation == DELETE_OPERATION) { File f = new File(info.getPathToData()); successfull = Algorithms.removeAllFiles(f); + if (InAppHelper.isSubscribedToLiveUpdates()) { + String fileNameWithoutExtension = + Algorithms.getFileNameWithoutExtension(f); + IncrementalChangesManager changesManager = + getMyApplication().getResourceManager().getChangesManager(); + changesManager.deleteUpdates(fileNameWithoutExtension); + } if (successfull) { getMyApplication().getResourceManager().closeFile(info.getFileName()); } From 2f43745cadc96af11f4b496a007b51a6e30339ec Mon Sep 17 00:00:00 2001 From: PaulStets Date: Tue, 19 Sep 2017 16:16:28 +0300 Subject: [PATCH 2/4] Fixed issue #4447 --- .../src/net/osmand/plus/download/ui/LocalIndexesFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index 539b22ccde..e7d6193aa2 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -467,14 +467,14 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement if (operation == DELETE_OPERATION) { File f = new File(info.getPathToData()); successfull = Algorithms.removeAllFiles(f); - if (InAppHelper.isSubscribedToLiveUpdates()) { + if (InAppHelper.isSubscribedToLiveUpdates()) { String fileNameWithoutExtension = Algorithms.getFileNameWithoutExtension(f); IncrementalChangesManager changesManager = getMyApplication().getResourceManager().getChangesManager(); changesManager.deleteUpdates(fileNameWithoutExtension); } - if (successfull) { + if (successfull) { getMyApplication().getResourceManager().closeFile(info.getFileName()); } } else if (operation == RESTORE_OPERATION) { From 1e72f7f5e30560d127069fbaa0f04c0263e36565 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Tue, 19 Sep 2017 16:18:33 +0300 Subject: [PATCH 3/4] Fixed issue #4447 --- .../plus/download/ui/LocalIndexesFragment.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index e7d6193aa2..79a106999f 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -467,14 +467,14 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement if (operation == DELETE_OPERATION) { File f = new File(info.getPathToData()); successfull = Algorithms.removeAllFiles(f); - if (InAppHelper.isSubscribedToLiveUpdates()) { - String fileNameWithoutExtension = - Algorithms.getFileNameWithoutExtension(f); - IncrementalChangesManager changesManager = - getMyApplication().getResourceManager().getChangesManager(); - changesManager.deleteUpdates(fileNameWithoutExtension); - } - if (successfull) { + if (InAppHelper.isSubscribedToLiveUpdates()) { + String fileNameWithoutExtension = + Algorithms.getFileNameWithoutExtension(f); + IncrementalChangesManager changesManager = + getMyApplication().getResourceManager().getChangesManager(); + changesManager.deleteUpdates(fileNameWithoutExtension); + } + if (successfull) { getMyApplication().getResourceManager().closeFile(info.getFileName()); } } else if (operation == RESTORE_OPERATION) { From 5182a723b1f1d2a70a50a4085be0a99a4c821b73 Mon Sep 17 00:00:00 2001 From: PaulStets Date: Tue, 19 Sep 2017 18:10:45 +0300 Subject: [PATCH 4/4] Fixed issue #4447 --- .../src/net/osmand/plus/download/ui/LocalIndexesFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index 79a106999f..e505d01157 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -55,7 +55,6 @@ import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; import net.osmand.plus.download.IndexItem; import net.osmand.plus.helpers.FileNameTranslationHelper; -import net.osmand.plus.inapp.InAppHelper; import net.osmand.plus.resources.IncrementalChangesManager; import net.osmand.util.Algorithms; @@ -467,7 +466,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement if (operation == DELETE_OPERATION) { File f = new File(info.getPathToData()); successfull = Algorithms.removeAllFiles(f); - if (InAppHelper.isSubscribedToLiveUpdates()) { + if (getMyApplication().getSettings().LIVE_UPDATES_PURCHASED.get()) { String fileNameWithoutExtension = Algorithms.getFileNameWithoutExtension(f); IncrementalChangesManager changesManager =