From 9d38b4ca4a920a1792f8028b5d234be745fed6a6 Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 29 Oct 2018 15:57:57 +0200 Subject: [PATCH] add const for gps expired time --- OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt index c11082e689..3745c3fe16 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt @@ -75,6 +75,8 @@ private const val BATTERY_OPTIMISATION_ASKED = "battery_optimisation_asked" private const val SHARING_INITIALIZATION_TIME = 60 * 2L // 2 minutes +private const val GPS_UPDATE_EXPIRED_TIME = 60 * 3L // 3 minutes + class TelegramSettings(private val app: TelegramApplication) { private var shareChatsInfo = ConcurrentHashMap() @@ -276,7 +278,7 @@ class TelegramSettings(private val app: TelegramApplication) { val gpsEnabled = try { if (lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) { val loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER) - loc != null && ((statusChangeTime - loc.time) / 1000) < 180 + loc != null && ((statusChangeTime - loc.time) / 1000) < GPS_UPDATE_EXPIRED_TIME } else { false }