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

[android] Revert adding mapbox-android-core dependency (#10354) #10380

Merged
merged 1 commit into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies {
compile rootProject.ext.dep.timber
compile rootProject.ext.dep.okhttp3
provided(rootProject.ext.dep.lost) {
exclude group: 'com.google.guava'
exclude group: 'com.android.support'
}
testCompile rootProject.ext.dep.junit
Expand All @@ -21,8 +22,6 @@ dependencies {
transitive = true
exclude group: 'com.android.support'
}

compile(rootProject.ext.dep.mapboxAndroidCore)
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.support.annotation.Nullable;

import com.mapbox.mapboxsdk.location.LocationSource;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;

class EmptyLocationSource extends LocationSource {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException;
import com.mapbox.mapboxsdk.location.LocationSource;
import com.mapbox.mapboxsdk.net.ConnectivityReceiver;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.core.location.LocationEnginePriority;
import com.mapbox.services.android.core.location.LocationEngineProvider;
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 com.mapbox.services.android.telemetry.MapboxTelemetry;

import timber.log.Timber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import android.support.annotation.Nullable;

import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.core.location.LocationEnginePriority;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEnginePriority;
import com.mapzen.android.lost.api.LocationListener;
import com.mapzen.android.lost.api.LocationRequest;
import com.mapzen.android.lost.api.LocationServices;
Expand All @@ -32,7 +32,7 @@
* @deprecated Use a {@link Mapbox#getLocationEngine()} instead.
*/
@Deprecated
public class LocationSource extends LocationEngine implements LostApiClient.ConnectionCallbacks, LocationListener {
public class LocationSource extends LocationEngine implements LocationListener {

private Context context;
private LostApiClient lostApiClient;
Expand All @@ -45,9 +45,7 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn
public LocationSource(Context context) {
super();
this.context = context.getApplicationContext();
lostApiClient = new LostApiClient.Builder(this.context)
.addConnectionCallbacks(this)
.build();
lostApiClient = new LostApiClient.Builder(this.context).build();
}

/**
Expand All @@ -63,9 +61,12 @@ public LocationSource() {
*/
@Override
public void activate() {
if (lostApiClient != null && !lostApiClient.isConnected()) {
if (!lostApiClient.isConnected()) {
lostApiClient.connect();
}
for (LocationEngineListener listener : locationListeners) {
listener.onConnected();
}
}

/**
Expand All @@ -75,7 +76,7 @@ public void activate() {
*/
@Override
public void deactivate() {
if (lostApiClient != null && lostApiClient.isConnected()) {
if (lostApiClient.isConnected()) {
lostApiClient.disconnect();
}
}
Expand All @@ -91,24 +92,6 @@ public boolean isConnected() {
return lostApiClient.isConnected();
}

/**
* Invoked when the location provider has connected.
*/
@Override
public void onConnected() {
for (LocationEngineListener listener : locationListeners) {
listener.onConnected();
}
}

/**
* Invoked when the location provider connection has been suspended.
*/
@Override
public void onConnectionSuspended() {
// Intentionally left empty
}

/**
* Returns the Last known location is the location provider is connected and location permissions are granted.
*
Expand All @@ -119,7 +102,7 @@ public void onConnectionSuspended() {
public Location getLastLocation() {
if (lostApiClient.isConnected()) {
//noinspection MissingPermission
return LocationServices.FusedLocationApi.getLastLocation(lostApiClient);
return LocationServices.FusedLocationApi.getLastLocation();
}
return null;
}
Expand Down Expand Up @@ -153,7 +136,7 @@ public void requestLocationUpdates() {

if (lostApiClient.isConnected()) {
//noinspection MissingPermission
LocationServices.FusedLocationApi.requestLocationUpdates(lostApiClient, request, this);
LocationServices.FusedLocationApi.requestLocationUpdates(request, this);
}
}

Expand All @@ -163,7 +146,7 @@ public void requestLocationUpdates() {
@Override
public void removeLocationUpdates() {
if (lostApiClient.isConnected()) {
LocationServices.FusedLocationApi.removeLocationUpdates(lostApiClient, this);
LocationServices.FusedLocationApi.removeLocationUpdates(this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import com.mapbox.mapboxsdk.style.layers.Layer;
import com.mapbox.mapboxsdk.style.light.Light;
import com.mapbox.mapboxsdk.style.sources.Source;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.commons.geojson.Feature;
import com.mapbox.services.commons.geojson.Geometry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import com.mapbox.mapboxsdk.constants.MyBearingTracking;
import com.mapbox.mapboxsdk.constants.MyLocationTracking;
import com.mapbox.mapboxsdk.maps.widgets.MyLocationView;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.permissions.PermissionsManager;

import timber.log.Timber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import com.mapbox.mapboxsdk.location.LocationSource;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.Projection;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.core.location.LocationEnginePriority;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEnginePriority;

import java.lang.ref.WeakReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.net.NetworkInfo;

import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException;
import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngine;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.animation.ValueAnimator;
import android.location.Location;

import com.mapbox.services.android.core.location.LocationEngine;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEngine;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;

import timber.log.Timber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.mapbox.mapboxsdk.maps.MapboxMapOptions;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.testapp.R;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;

/**
* Test activity showcasing how to change the MyLocationView drawable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.mapbox.mapboxsdk.maps.TrackingSettings;
import com.mapbox.mapboxsdk.maps.UiSettings;
import com.mapbox.mapboxsdk.testapp.R;
import com.mapbox.services.android.core.location.LocationEngineListener;
import com.mapbox.services.android.telemetry.location.LocationEngineListener;

import timber.log.Timber;

Expand Down
6 changes: 2 additions & 4 deletions platform/android/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ ext {
versionCode = 11
versionName = "5.0.0"

mapboxServicesVersion = "2.2.7"
mapboxAndroidCoreVersion = "0.1.1"
mapboxServicesVersion = "2.2.8"
supportLibVersion = "25.4.0"
espressoVersion = '3.0.1'
testRunnerVersion = '1.0.1'
Expand All @@ -19,10 +18,9 @@ ext {
mapboxJavaServices : "com.mapbox.mapboxsdk:mapbox-java-services:${mapboxServicesVersion}@jar",
mapboxJavaGeoJSON : "com.mapbox.mapboxsdk:mapbox-java-geojson:${mapboxServicesVersion}@jar",
mapboxAndroidTelemetry : "com.mapbox.mapboxsdk:mapbox-android-telemetry:${mapboxServicesVersion}@aar",
mapboxAndroidCore : "com.mapbox.mapboxsdk:mapbox-android-core:${mapboxAndroidCoreVersion}@aar",

// mapzen lost
lost : 'com.mapzen.android:lost:3.0.4',
lost : 'com.mapzen.android:lost:1.1.1',

// unit test
junit : 'junit:junit:4.12',
Expand Down