From e6dbc10289d5d2cb6178ca8f9e718f9109c3d8d6 Mon Sep 17 00:00:00 2001 From: alex-osm Date: Fri, 23 Jun 2023 09:28:08 +0300 Subject: [PATCH] Upgrade gms-location version --- OsmAnd/build-common.gradle | 2 +- .../helpers/GmsLocationServiceHelper.java | 24 +------------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/OsmAnd/build-common.gradle b/OsmAnd/build-common.gradle index 78dc2f9b3d9..b3069f55c5b 100644 --- a/OsmAnd/build-common.gradle +++ b/OsmAnd/build-common.gradle @@ -419,5 +419,5 @@ dependencies { implementation "androidx.car.app:app:1.2.0" implementation "androidx.car.app:app-projected:1.2.0" - implementation 'com.google.android.gms:play-services-location:20.0.0' + implementation 'com.google.android.gms:play-services-location:21.0.1' } diff --git a/OsmAnd/src/net/osmand/plus/helpers/GmsLocationServiceHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GmsLocationServiceHelper.java index ca7bf173d99..7d8d78859e2 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GmsLocationServiceHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GmsLocationServiceHelper.java @@ -44,29 +44,7 @@ public GmsLocationServiceHelper(@NonNull OsmandApplication app) { this.app = app; fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(app); - - fusedLocationRequest = LocationRequest.create() - // Sets the desired interval for active location updates. This interval is inexact. You - // may not receive updates at all if no location sources are available, or you may - // receive them less frequently than requested. You may also receive updates more - // frequently than requested if other applications are requesting location at a more - // frequent interval. - // - // IMPORTANT NOTE: Apps running on Android 8.0 and higher devices (regardless of - // targetSdkVersion) may receive updates less frequently than this interval when the app - // is no longer in the foreground. - .setInterval(100) - - // Sets the fastest rate for active location updates. This interval is exact, and your - // application will never receive updates more frequently than this value. - //.setFastestInterval(50) - - // Sets the maximum time when batched location updates are delivered. Updates may be - // delivered sooner than this interval. - .setMaxWaitTime(0) - - .setPriority(Priority.PRIORITY_HIGH_ACCURACY); - + fusedLocationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 100).build(); fusedLocationCallback = new com.google.android.gms.location.LocationCallback() { @Override public void onLocationResult(@NonNull LocationResult locationResult) {