Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - try/catch initalisation of Telemetry (#9658)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Aug 1, 2017
1 parent 63c1aaa commit 607905b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
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>
Expand Down Expand Up @@ -48,8 +50,14 @@ public static synchronized Mapbox getInstance(@NonNull Context context, @NonNull
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;
Expand Down

0 comments on commit 607905b

Please sign in to comment.