From ca60095071bbc2938011957b524c511ba15ff49d Mon Sep 17 00:00:00 2001 From: Alexander Eggers Date: Fri, 29 Mar 2019 11:44:58 +1100 Subject: [PATCH] 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. --- .../mapbox/mapboxsdk/location/LocationComponent.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 327ab3c8e..d643795c0 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; + } +}