diff options
author | Guardiola31337 <pablo.guardiola@mapbox.com> | 2017-11-03 13:26:38 -0700 |
---|---|---|
committer | Guardiola31337 <pablo.guardiola@mapbox.com> | 2017-11-03 13:28:25 -0700 |
commit | 8f7e471df4e6446dbc18e7b5ed30c5929fd56d52 (patch) | |
tree | b8a61c4141de71ed4f3aae191f0486931e8cc914 | |
parent | d1d0c200442133e2eca110e3521f1caf831eda5c (diff) | |
download | qtlocation-mapboxgl-upstream/pg-revert-android-core.tar.gz |
[android] revert adding mapbox-android-core dependency (#10354)upstream/pg-revert-android-core
13 files changed, 33 insertions, 53 deletions
diff --git a/circle.yml b/circle.yml index 0d1651e01d..30e607c9c3 100644 --- a/circle.yml +++ b/circle.yml @@ -320,7 +320,7 @@ jobs: - deploy: name: Publish to Maven command: | - if [ "${CIRCLE_BRANCH}" == "release-agua" ]; then make run-android-upload-archives ; fi + if [ "${CIRCLE_BRANCH}" == "pg-revert-android-core" ]; then make run-android-upload-archives ; fi # ------------------------------------------------------------------------------ diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index 49806780b5..f3e9433a0b 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -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 @@ -21,8 +22,6 @@ dependencies { transitive = true exclude group: 'com.android.support' } - - compile(rootProject.ext.dep.mapboxAndroidCore) } android { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/EmptyLocationSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/EmptyLocationSource.java index d24ed5a113..8ea7e61eee 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/EmptyLocationSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/EmptyLocationSource.java @@ -5,8 +5,8 @@ import android.location.Location; 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 { 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 e575dc9062..357bcd5f99 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 @@ -12,9 +12,9 @@ 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.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; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java index 5129db08e8..c6bc13f538 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java @@ -5,9 +5,9 @@ import android.location.Location; 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; @@ -32,7 +32,7 @@ import com.mapzen.android.lost.api.LostApiClient; * @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; @@ -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(); } /** @@ -63,9 +61,12 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn */ @Override public void activate() { - if (lostApiClient != null && !lostApiClient.isConnected()) { + if (!lostApiClient.isConnected()) { lostApiClient.connect(); } + for (LocationEngineListener listener : locationListeners) { + listener.onConnected(); + } } /** @@ -75,7 +76,7 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn */ @Override public void deactivate() { - if (lostApiClient != null && lostApiClient.isConnected()) { + if (lostApiClient.isConnected()) { lostApiClient.disconnect(); } } @@ -92,24 +93,6 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn } /** - * 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. * * @return the last known location @@ -119,7 +102,7 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn public Location getLastLocation() { if (lostApiClient.isConnected()) { //noinspection MissingPermission - return LocationServices.FusedLocationApi.getLastLocation(lostApiClient); + return LocationServices.FusedLocationApi.getLastLocation(); } return null; } @@ -153,7 +136,7 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn if (lostApiClient.isConnected()) { //noinspection MissingPermission - LocationServices.FusedLocationApi.requestLocationUpdates(lostApiClient, request, this); + LocationServices.FusedLocationApi.requestLocationUpdates(request, this); } } @@ -163,7 +146,7 @@ public class LocationSource extends LocationEngine implements LostApiClient.Conn @Override public void removeLocationUpdates() { if (lostApiClient.isConnected()) { - LocationServices.FusedLocationApi.removeLocationUpdates(lostApiClient, this); + LocationServices.FusedLocationApi.removeLocationUpdates(this); } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java index f0461b6307..6bf8342efb 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java @@ -42,7 +42,7 @@ import com.mapbox.mapboxsdk.style.layers.Filter; 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; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java index 2f85c82587..6eacbbaeaf 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java @@ -12,8 +12,8 @@ import com.mapbox.mapboxsdk.constants.MapboxConstants; 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; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java index cc7602e056..aa7934ec1e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java @@ -36,9 +36,9 @@ import com.mapbox.mapboxsdk.geometry.LatLng; 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; diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/MapboxTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/MapboxTest.java index 09acf3feef..7a28d846ea 100644 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/MapboxTest.java +++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/MapboxTest.java @@ -5,7 +5,7 @@ import android.net.ConnectivityManager; 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; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java index bfc04dc1e6..df52ccf727 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java @@ -5,8 +5,8 @@ import android.animation.TypeEvaluator; 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; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java index 2b681f6983..62b4f4b987 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationDrawableActivity.java @@ -16,7 +16,7 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; 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. diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTrackingModeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTrackingModeActivity.java index 726d13a516..d910a19d5d 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTrackingModeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MyLocationTrackingModeActivity.java @@ -25,7 +25,7 @@ import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; 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; diff --git a/platform/android/dependencies.gradle b/platform/android/dependencies.gradle index 47a534fac3..90afcf8763 100644 --- a/platform/android/dependencies.gradle +++ b/platform/android/dependencies.gradle @@ -7,8 +7,7 @@ ext { versionCode = 11 versionName = "5.0.0" - mapboxServicesVersion = "2.2.7" - mapboxAndroidCoreVersion = "0.1.1" + mapboxServicesVersion = "2.3.0-SNAPSHOT" supportLibVersion = "25.4.0" espressoVersion = '3.0.1' testRunnerVersion = '1.0.1' @@ -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', |