diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/TelemetryLocationReceiver.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/TelemetryLocationReceiver.java index c18da41e4..3e594b530 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/TelemetryLocationReceiver.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/telemetry/TelemetryLocationReceiver.java @@ -6,15 +6,12 @@ import android.content.Intent; import android.location.Location; import android.location.LocationManager; import android.os.Handler; -import android.util.Log; /** * Listener for Location updates generated by implementing app. */ public class TelemetryLocationReceiver extends BroadcastReceiver { - private static final String TAG = "TelemLocationReceiver"; - public static final String INTENT_STRING = "com.mapbox.mapboxsdk.telemetry.TelemetryLocationReceiver"; /** @@ -61,12 +58,14 @@ public class TelemetryLocationReceiver extends BroadcastReceiver { */ @Override public void onReceive(Context context, Intent intent) { - Location location = (Location)intent.getExtras().get(LocationManager.KEY_LOCATION_CHANGED); + if (intent == null || intent.getExtras() == null) { + // see https://github.com/mapbox/mapbox-gl-native/issues/6934 + return; + } + + Location location = (Location) intent.getExtras().get(LocationManager.KEY_LOCATION_CHANGED); if (location != null) { -// Log.d(TAG, "location received = " + location); MapboxEventManager.getMapboxEventManager().addLocationEvent(location); - } else { - Log.d(TAG, "location NOT received"); } } }