From 6b99ea420f7c528d1a06634bb097d0115fdccfa6 Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 30 Aug 2018 13:20:28 +0300 Subject: [PATCH] Remove unnecessary changes --- .../src/net/osmand/telegram/helpers/ShowLocationHelper.kt | 6 +++--- OsmAnd/src/net/osmand/aidl/OsmandAidlService.java | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt index d607ca8356..1776270e9e 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt @@ -148,7 +148,7 @@ class ShowLocationHelper(private val app: TelegramApplication) { fun startShowingLocation() { if (!showingLocation) { - showingLocation = if (isOsmandUseCallback()) { + showingLocation = if (isUseOsmandCallback()) { osmandAidlHelper.registerForUpdates() } else { app.startUserLocationService() @@ -160,7 +160,7 @@ class ShowLocationHelper(private val app: TelegramApplication) { fun stopShowingLocation() { if (showingLocation) { showingLocation = false - if (isOsmandUseCallback()) { + if (isUseOsmandCallback()) { osmandAidlHelper.unregisterFromUpdates() } else { app.stopUserLocationService() @@ -168,7 +168,7 @@ class ShowLocationHelper(private val app: TelegramApplication) { } } - fun isOsmandUseCallback(): Boolean { + fun isUseOsmandCallback(): Boolean { val packageOsmAndInfo = app.packageManager.getPackageInfo(app.settings.appToConnectPackage, 0) return packageOsmAndInfo.versionCode >= MIN_OSMAND_CALLBACK_VERSION_CODE } diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java index eb1feda70a..c5cac6166d 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java @@ -82,7 +82,6 @@ public class OsmandAidlService extends Service { HandlerThread mHandlerThread = new HandlerThread("OsmAndAidlServiceThread"); private boolean updatesStarted = false; - private boolean shouldStopUpdates = false; OsmandApplication getApp() { return (OsmandApplication) getApplication(); @@ -589,7 +588,6 @@ public class OsmandAidlService extends Service { if (!updatesStarted) { startRemoteUpdates(); updatesStarted = true; - shouldStopUpdates = false; } return true; } @@ -606,7 +604,6 @@ public class OsmandAidlService extends Service { i.remove(); } } - shouldStopUpdates = callbacks.isEmpty(); return true; } return false; @@ -624,7 +621,7 @@ public class OsmandAidlService extends Service { e.printStackTrace(); } } - if (shouldStopUpdates) { + if (callbacks.isEmpty()) { updatesStarted = false; } else { startRemoteUpdates();