summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Paczos <lukasz.paczos@mapbox.com>2018-01-29 15:36:38 -0500
committerTobrun <tobrun@mapbox.com>2018-02-05 12:19:41 +0100
commit3714aa94e779b4a5a3d6d531b6a4273ae2275ba5 (patch)
treea384b64dd385e10fd130987824f6e11188044884
parent954c20b8c1832e0d94c4495a152b795df56ae967 (diff)
downloadqtlocation-mapboxgl-3714aa94e779b4a5a3d6d531b6a4273ae2275ba5.tar.gz
[android] - log lack of permissions only if enabling location
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java
index 6eacbbaeaf..81fd091c90 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java
@@ -374,7 +374,7 @@ public final class TrackingSettings {
}
private void setMyLocationEnabled(boolean locationEnabled, boolean isCustomLocationSource) {
- if (!PermissionsManager.areLocationPermissionsGranted(myLocationView.getContext())) {
+ if (locationEnabled && !PermissionsManager.areLocationPermissionsGranted(myLocationView.getContext())) {
Timber.e("Could not activate user location tracking: "
+ "user did not accept the permission or permissions were not requested.");
return;