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

Commit

Permalink
[android] integration of the new events library
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Jan 23, 2018
1 parent 2d15aed commit a30a81b
Show file tree
Hide file tree
Showing 28 changed files with 186 additions and 537 deletions.
1 change: 0 additions & 1 deletion platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ android {

lintOptions {
disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission'
baseline file("lint-baseline-local.xml")
checkAllWarnings true
warningsAsErrors false
}
Expand Down
37 changes: 0 additions & 37 deletions platform/android/MapboxGLAndroidSDK/lint-baseline-local.xml

This file was deleted.

44 changes: 0 additions & 44 deletions platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
import android.support.annotation.UiThread;
import android.text.TextUtils;

import com.mapbox.android.core.location.LocationEngine;
import com.mapbox.android.core.location.LocationEnginePriority;
import com.mapbox.android.core.location.LocationEngineProvider;
import com.mapbox.android.telemetry.MapboxTelemetry;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException;
import com.mapbox.mapboxsdk.location.LocationSource;
import com.mapbox.mapboxsdk.net.ConnectivityReceiver;
import com.mapbox.services.android.telemetry.MapboxTelemetry;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEnginePriority;
import com.mapbox.services.android.telemetry.location.LocationEngineProvider;

import timber.log.Timber;

Expand All @@ -36,6 +35,8 @@ public final class Mapbox {
private String accessToken;
private Boolean connected;
private LocationEngine locationEngine;
@SuppressLint("StaticFieldLeak")
private static MapboxTelemetry telemetry;

/**
* Get an instance of Mapbox.
Expand All @@ -57,8 +58,8 @@ public static synchronized Mapbox getInstance(@NonNull Context context, @NonNull
locationEngine.setPriority(LocationEnginePriority.NO_POWER);

try {
MapboxTelemetry.getInstance().initialize(
appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT, locationEngine);
telemetry = new MapboxTelemetry(appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT);
telemetry.enable();
} catch (Exception exception) {
Timber.e(exception, "Unable to instantiate Mapbox telemetry");
}
Expand Down Expand Up @@ -145,18 +146,6 @@ public static synchronized Boolean isConnected() {
return (activeNetwork != null && activeNetwork.isConnected());
}

/**
* Returns a location source instance with empty methods.
*
* @return an empty location source implementation
* @deprecated Replaced by {@link Mapbox#getLocationEngine()}
*/
@Deprecated
public static LocationSource getLocationSource() {
return new EmptyLocationSource();
}


/**
* Returns the location engine used by the SDK.
*
Expand All @@ -165,4 +154,8 @@ public static LocationSource getLocationSource() {
public static LocationEngine getLocationEngine() {
return INSTANCE.locationEngine;
}

public static MapboxTelemetry obtainTelemetry() {
return INSTANCE.telemetry;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.services.android.telemetry.utils.MathUtils;
import com.mapbox.mapboxsdk.utils.MathUtils;

/**
* Resembles the position, angle, zoom and tilt of the user's viewpoint.
Expand Down
Loading

0 comments on commit a30a81b

Please sign in to comment.