Remove unnecessary changes

This commit is contained in:
Chumva 2018-08-30 13:20:28 +03:00
parent 7948a66e58
commit 6b99ea420f
2 changed files with 4 additions and 7 deletions

View file

@ -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
}

View file

@ -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();