summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Eggers <Mordag@users.noreply.github.com>2019-03-29 11:44:58 +1100
committerŁukasz Paczos <lukasz.paczos@mapbox.com>2019-04-05 11:47:28 +0200
commitca60095071bbc2938011957b524c511ba15ff49d (patch)
treefe14b5ab9868bab557e2fbd32ae532a45b162e54
parent35bcb7c0722897879fcdc2fb71c6fb9fa5798e79 (diff)
downloadqtlocation-mapboxgl-ca60095071bbc2938011957b524c511ba15ff49d.tar.gz
Added getter for the field isComponentInitialized
This change is meanly because of https://github.com/mapbox/mapbox-gl-native/pull/14068 which is now throwing an exception when the component is not activated. This getter should help users to identify if the component is not activated yet to prevent usage and therefore exceptions.
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
index 327ab3c8ed..d643795c04 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationComponent.java
@@ -1509,4 +1509,13 @@ public final class LocationComponent {
throw new LocationComponentNotInitializedException();
}
}
-} \ No newline at end of file
+
+ /**
+ * Returns whether the location component is activated.
+ *
+ * @return true if the component is activated, false otherwise
+ */
+ public boolean isLocationComponentActivated() {
+ return isComponentInitialized;
+ }
+}