diff options
author | Tobrun <tobrun@mapbox.com> | 2017-08-01 15:25:24 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2017-08-01 22:00:46 +0200 |
commit | e4a61426bf1893637617159ebea5b61b37114d12 (patch) | |
tree | 27ac26a57167f9aad5d6d1f07f56fbfeb2ec5ab3 /platform | |
parent | 21bbf5a9e0e82e60250f5b05dd5430052a7b2469 (diff) | |
download | qtlocation-mapboxgl-e4a61426bf1893637617159ebea5b61b37114d12.tar.gz |
[android] - try/catch initalisation of Telemetry (#9658)
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java index 6722000be7..eadc3fdcf5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java @@ -15,6 +15,8 @@ import com.mapbox.services.android.telemetry.MapboxTelemetry; import com.mapbox.services.android.telemetry.location.LocationEngine; import com.mapbox.services.android.telemetry.location.LocationEnginePriority; +import timber.log.Timber; + /** * The entry point to initialize the Mapbox Android SDK. * <p> @@ -48,8 +50,14 @@ public final class Mapbox { INSTANCE = new Mapbox(appContext, accessToken, new LocationSource(appContext)); LocationEngine locationEngine = new LocationSource(appContext); locationEngine.setPriority(LocationEnginePriority.NO_POWER); - MapboxTelemetry.getInstance().initialize( - appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine); + + try { + MapboxTelemetry.getInstance().initialize( + appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine); + } catch (Exception exception) { + Timber.e(exception, "Unable to instantiate Mapbox telemetry"); + } + ConnectivityReceiver.instance(appContext); } return INSTANCE; |