summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun@mapbox.com>2017-08-01 15:25:24 +0200
committerGitHub <noreply@github.com>2017-08-01 15:25:24 +0200
commitc93c21ccf7833719d184817b7675fab300d28c3f (patch)
tree3986e7fc0f2ae311fd3aa8e590629f9503c35459
parentde46df21a7c630e5b4d658adee2288bb8f3882aa (diff)
downloadqtlocation-mapboxgl-c93c21ccf7833719d184817b7675fab300d28c3f.tar.gz
[android] - try/catch initalisation of Telemetry (#9658)
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java12
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 70b13f05fb..7fd9d6172d 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
@@ -16,6 +16,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>
@@ -51,8 +53,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;