diff --git a/LICENSE.md b/LICENSE.md index c7edbcac4b6..a56df857cdc 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -148,14 +148,20 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== -Mapbox Navigation uses portions of the Android Lifecycle Runtime. +Mapbox Navigation uses portions of the Android Arch-Runtime. URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== +Mapbox Navigation uses portions of the Android Lifecycle Runtime. +URL: [https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1) +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Navigation uses portions of the Android Lifecycle-Common. -URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html) +URL: [https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== @@ -173,7 +179,7 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== Mapbox Navigation uses portions of the Android Support Library compat (The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.). -URL: [https://developer.android.com/jetpack/androidx/releases/core#1.6.0](https://developer.android.com/jetpack/androidx/releases/core#1.6.0) +URL: [https://developer.android.com/jetpack/androidx/releases/core#1.7.0](https://developer.android.com/jetpack/androidx/releases/core#1.7.0) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== @@ -184,6 +190,12 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== +Mapbox Navigation uses portions of the AndroidX Futures (Androidx implementation of Guava's ListenableFuture). +URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html) +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Navigation uses portions of the auto-value-gson-runtime. License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -201,7 +213,7 @@ License: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== Mapbox Navigation uses portions of the Core Kotlin Extensions (Kotlin extensions for 'core' artifact). -URL: [https://developer.android.com/jetpack/androidx/releases/core#1.6.0](https://developer.android.com/jetpack/androidx/releases/core#1.6.0) +URL: [https://developer.android.com/jetpack/androidx/releases/core#1.7.0](https://developer.android.com/jetpack/androidx/releases/core#1.7.0) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== @@ -217,6 +229,27 @@ License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== +Mapbox Navigation uses portions of the Guava ListenableFuture only (Contains Guava's com.google.common.util.concurrent.ListenableFuture class, + without any of its other classes -- but is also available in a second + "version" that omits the class to avoid conflicts with the copy in Guava + itself. The idea is: + + - If users want only ListenableFuture, they depend on listenablefuture-1.0. + + - If users want all of Guava, they depend on guava, which, as of Guava + 27.0, depends on + listenablefuture-9999.0-empty-to-avoid-conflict-with-guava. The 9999.0-... + version number is enough for some build systems (notably, Gradle) to select + that empty artifact over the "real" listenablefuture-1.0 -- avoiding a + conflict with the copy of ListenableFuture in guava itself. If users are + using an older version of Guava or a build system other than Gradle, they + may see class conflicts. If so, they can solve them by manually excluding + the listenablefuture artifact or manually forcing their build systems to + use 9999.0-....). +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Navigation uses portions of the IntelliJ IDEA Annotations (A set of annotations used for code inspection support and code documentation.). URL: [http://www.jetbrains.org](http://www.jetbrains.org) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -668,14 +701,20 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== -Mapbox Navigation uses portions of the Android Lifecycle Runtime. +Mapbox Navigation uses portions of the Android Arch-Runtime. URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== +Mapbox Navigation uses portions of the Android Lifecycle Runtime. +URL: [https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1) +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Navigation uses portions of the Android Lifecycle-Common. -URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html) +URL: [https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.3.1) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== @@ -693,7 +732,7 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== Mapbox Navigation uses portions of the Android Support Library compat (The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.). -URL: [https://developer.android.com/jetpack/androidx/releases/core#1.6.0](https://developer.android.com/jetpack/androidx/releases/core#1.6.0) +URL: [https://developer.android.com/jetpack/androidx/releases/core#1.7.0](https://developer.android.com/jetpack/androidx/releases/core#1.7.0) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== @@ -704,6 +743,12 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== +Mapbox Navigation uses portions of the AndroidX Futures (Androidx implementation of Guava's ListenableFuture). +URL: [https://developer.android.com/topic/libraries/architecture/index.html](https://developer.android.com/topic/libraries/architecture/index.html) +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Navigation uses portions of the auto-value-gson-runtime. License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -716,7 +761,7 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens =========================================================================== Mapbox Navigation uses portions of the Core Kotlin Extensions (Kotlin extensions for 'core' artifact). -URL: [https://developer.android.com/jetpack/androidx](https://developer.android.com/jetpack/androidx) +URL: [https://developer.android.com/jetpack/androidx/releases/core#1.7.0](https://developer.android.com/jetpack/androidx/releases/core#1.7.0) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== @@ -732,6 +777,27 @@ License: [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) =========================================================================== +Mapbox Navigation uses portions of the Guava ListenableFuture only (Contains Guava's com.google.common.util.concurrent.ListenableFuture class, + without any of its other classes -- but is also available in a second + "version" that omits the class to avoid conflicts with the copy in Guava + itself. The idea is: + + - If users want only ListenableFuture, they depend on listenablefuture-1.0. + + - If users want all of Guava, they depend on guava, which, as of Guava + 27.0, depends on + listenablefuture-9999.0-empty-to-avoid-conflict-with-guava. The 9999.0-... + version number is enough for some build systems (notably, Gradle) to select + that empty artifact over the "real" listenablefuture-1.0 -- avoiding a + conflict with the copy of ListenableFuture in guava itself. If users are + using an older version of Guava or a build system other than Gradle, they + may see class conflicts. If so, they can solve them by manually excluding + the listenablefuture artifact or manually forcing their build systems to + use 9999.0-....). +License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +=========================================================================== + Mapbox Navigation uses portions of the IntelliJ IDEA Annotations (A set of annotations used for code inspection support and code documentation.). URL: [http://www.jetbrains.org](http://www.jetbrains.org) License: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1439,7 +1505,7 @@ License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos) Mapbox Navigation uses portions of the Mapbox Android Core SDK. URL: [https://github.com/mapbox/mapbox-sdk](https://github.com/mapbox/mapbox-sdk) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== @@ -1481,13 +1547,13 @@ License: [BSD](https://opensource.org/licenses/BSD-2-Clause) Mapbox Navigation uses portions of the Mapbox Maps SDK. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the Mapbox Maps SDK Base. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== @@ -1511,85 +1577,85 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens Mapbox Navigation uses portions of the Telemetry for the Mapbox Maps SDK. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The annotation module for the Mapbox Maps SDK. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The attribution module for the Mapbox Maps SDK. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The camera animation module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The compass module for the Mapbox Maps SDK. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The gestures module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The location component module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The logo module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The map lifecycle module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The map localization module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The map overlay module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The scalebar module for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The style extension for the Mapbox Maps SDK for Android. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== Mapbox Navigation uses portions of the The viewport module for the Mapbox Maps SDK. URL: [https://github.com/mapbox/mapbox-maps-android](https://github.com/mapbox/mapbox-maps-android) -License: [BSD](https://opensource.org/licenses/BSD-2-Clause) +License: [Mapbox Terms of Service](https://www.mapbox.com/legal/tos/) =========================================================================== diff --git a/changelog/unreleased/features/6833.md b/changelog/unreleased/features/6833.md new file mode 100644 index 00000000000..7c62232da17 --- /dev/null +++ b/changelog/unreleased/features/6833.md @@ -0,0 +1,14 @@ +- Added `RoadComponent.language` value. +- :warning: Changed `EHorizonEdgeMetadata.names` class from `RoadName` to `RoadComponent`. + To migrate change your code from: +```kotlin +val shielded = roadName.shielded +``` +into: +```kotlin +val shielded = roadComponent.shield != null +``` +- Added support for continuous EV alternatives in `NavigationRouteAlternativesObserver`. +- Fixed issues with map-matching to HOV-only roads. +- Set a limit of simultaneously running onboard route requests to avoid too many tasks blocking too much of the device's computing resources. +- Fixed an issue with Road Access Policy ignoring the setting to map-match to closed road sections, when enabled. \ No newline at end of file diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 0ebb6f47790..9a1f48e2335 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -13,15 +13,15 @@ ext { // version which we should use in this build def mapboxNavigatorVersion = System.getenv("FORCE_MAPBOX_NAVIGATION_NATIVE_VERSION") if (mapboxNavigatorVersion == null || mapboxNavigatorVersion == '') { - mapboxNavigatorVersion = '123.2.0' + mapboxNavigatorVersion = '124.0.1' } println("Navigation Native version: " + mapboxNavigatorVersion) version = [ - mapboxMapSdk : '10.10.0', + mapboxMapSdk : '10.11.0-beta.1', mapboxSdkServices : '6.10.0', mapboxNavigator : "${mapboxNavigatorVersion}", - mapboxCommonNative : '23.2.1', + mapboxCommonNative : '23.3.0-beta.1', mapboxCrashMonitor : '2.0.0', mapboxAnnotationPlugin : '0.8.0', mapboxBaseAndroid : '0.8.0', diff --git a/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/WaypointsTest.kt b/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/WaypointsTest.kt index 2cd64fd0bb2..2696559c635 100644 --- a/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/WaypointsTest.kt +++ b/instrumentation-tests/src/androidTest/java/com/mapbox/navigation/instrumentation_tests/core/WaypointsTest.kt @@ -53,7 +53,7 @@ class WaypointsTest : BaseTest(EmptyTestActivity::class.java) ) private lateinit var mapboxNavigation: MapboxNavigation - private val tolerance = 0.00001 + private val tolerance = 0.0001 private val expectedEvWaypointsNamesAndLocations = listOf( "Leopoldstraße" to ApproximateCoordinates(48.176099, 11.585226, tolerance), "" to ApproximateCoordinates(48.39023, 11.063842, tolerance), diff --git a/libnavigation-base/api/current.txt b/libnavigation-base/api/current.txt index c436e261a65..0a3dc23fc8b 100644 --- a/libnavigation-base/api/current.txt +++ b/libnavigation-base/api/current.txt @@ -615,9 +615,11 @@ package com.mapbox.navigation.base.road.model { public final class RoadComponent { method public String? getImageBaseUrl(); + method public String getLanguage(); method public com.mapbox.api.directions.v5.models.MapboxShield? getShield(); method public String getText(); property public final String? imageBaseUrl; + property public final String language; property public final com.mapbox.api.directions.v5.models.MapboxShield? shield; property public final String text; } @@ -1020,7 +1022,7 @@ package com.mapbox.navigation.base.trip.model.eh { method public double getLength(); method public Double? getMeanElevation(); method public boolean getMotorway(); - method public java.util.List getNames(); + method public java.util.List getNames(); method public boolean getRamp(); method public String getRoadSurface(); method public double getSpeed(); @@ -1044,7 +1046,7 @@ package com.mapbox.navigation.base.trip.model.eh { property public final double length; property public final Double? meanElevation; property public final boolean motorway; - property public final java.util.List names; + property public final java.util.List names; property public final boolean ramp; property public final String roadSurface; property public final double speed; @@ -1156,13 +1158,6 @@ package com.mapbox.navigation.base.trip.model.eh { @StringDef({com.mapbox.navigation.base.trip.model.eh.RoadClass.MOTORWAY, com.mapbox.navigation.base.trip.model.eh.RoadClass.TRUNK, com.mapbox.navigation.base.trip.model.eh.RoadClass.PRIMARY, com.mapbox.navigation.base.trip.model.eh.RoadClass.SECONDARY, com.mapbox.navigation.base.trip.model.eh.RoadClass.TERTIARY, com.mapbox.navigation.base.trip.model.eh.RoadClass.UNCLASSIFIED, com.mapbox.navigation.base.trip.model.eh.RoadClass.RESIDENTIAL, com.mapbox.navigation.base.trip.model.eh.RoadClass.SERVICE_OTHER}) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) public static @interface RoadClass.Type { } - public final class RoadName { - method public String getName(); - method public boolean getShielded(); - property public final String name; - property public final boolean shielded; - } - public final class RoadSurface { field public static final String COMPACTED = "COMPACTED"; field public static final String DIRT = "DIRT"; diff --git a/libnavigation-base/src/main/java/com/mapbox/navigation/base/internal/factory/RoadFactory.kt b/libnavigation-base/src/main/java/com/mapbox/navigation/base/internal/factory/RoadFactory.kt index 6e8a552bbe8..8b00ffe2019 100644 --- a/libnavigation-base/src/main/java/com/mapbox/navigation/base/internal/factory/RoadFactory.kt +++ b/libnavigation-base/src/main/java/com/mapbox/navigation/base/internal/factory/RoadFactory.kt @@ -18,6 +18,7 @@ object RoadFactory { text = road.text, shield = road.shield.toMapboxShield(), imageBaseUrl = road.imageBaseUrl, + language = road.language, ) } return Road( diff --git a/libnavigation-base/src/main/java/com/mapbox/navigation/base/road/model/RoadComponent.kt b/libnavigation-base/src/main/java/com/mapbox/navigation/base/road/model/RoadComponent.kt index fe117ef1d83..88db15e94c7 100644 --- a/libnavigation-base/src/main/java/com/mapbox/navigation/base/road/model/RoadComponent.kt +++ b/libnavigation-base/src/main/java/com/mapbox/navigation/base/road/model/RoadComponent.kt @@ -4,12 +4,19 @@ import com.mapbox.api.directions.v5.models.MapboxShield /** * Object that holds road components - * @property text of the road + * @property text contains the current road name user is on, based on the [language] available. + * In certain situations there can be [RoadComponent] that contain [text] as `/` separator. + * The purpose of these separators is to separate the current road name in cases they have a primary + * and secondary name. If you are using [MapboxRoadNameView], then these separators are used to + * separate these names. However if you don't want to use them, you are can directly get access to + * [RoadComponent] from [LocationMatcherResult] and filter the names without `/` separators. + * @property language 2 letters language code or "Unspecified" or empty string * @property shield mapbox designed shield if available otherwise null * @property imageBaseUrl url for the route shield if available otherwise null */ class RoadComponent internal constructor( val text: String, + val language: String, val shield: MapboxShield? = null, val imageBaseUrl: String? = null ) { @@ -23,6 +30,7 @@ class RoadComponent internal constructor( other as RoadComponent if (text != other.text) return false + if (language != other.language) return false if (shield != other.shield) return false if (imageBaseUrl != other.imageBaseUrl) return false @@ -34,6 +42,7 @@ class RoadComponent internal constructor( */ override fun hashCode(): Int { var result = text.hashCode() + result = 31 * result + language.hashCode() result = 31 * result + (shield?.hashCode() ?: 0) result = 31 * result + (imageBaseUrl?.hashCode() ?: 0) return result @@ -43,6 +52,11 @@ class RoadComponent internal constructor( * Returns a string representation of the object. */ override fun toString(): String { - return "RoadComponent(text='$text', shield=$shield, imageBaseUrl=$imageBaseUrl)" + return "RoadComponent(" + + "text='$text', " + + "language='$language', " + + "shield=$shield, " + + "imageBaseUrl=$imageBaseUrl" + + ")" } } diff --git a/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonEdgeMetadata.kt b/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonEdgeMetadata.kt index c8b6cf25b04..3dfc581b227 100644 --- a/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonEdgeMetadata.kt +++ b/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonEdgeMetadata.kt @@ -1,5 +1,7 @@ package com.mapbox.navigation.base.trip.model.eh +import com.mapbox.navigation.base.road.model.RoadComponent + /** * Edge metadata * @@ -45,7 +47,7 @@ class EHorizonEdgeMetadata internal constructor( val bridge: Boolean, val tunnel: Boolean, val toll: Boolean, - val names: List, + val names: List, val laneCount: Byte?, val meanElevation: Double?, val curvature: Byte, diff --git a/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonMapper.kt b/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonMapper.kt index aea6453ef83..1537f68d7d4 100644 --- a/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonMapper.kt +++ b/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonMapper.kt @@ -1,5 +1,7 @@ package com.mapbox.navigation.base.trip.model.eh +import com.mapbox.navigation.base.internal.extensions.toMapboxShield +import com.mapbox.navigation.base.road.model.RoadComponent import com.mapbox.navigation.base.trip.model.roadobject.RoadObjectPosition import com.mapbox.navigation.base.trip.model.roadobject.distanceinfo.GantryDistanceInfo import com.mapbox.navigation.base.trip.model.roadobject.distanceinfo.Gate @@ -408,18 +410,20 @@ private fun FunctionalRoadClass.mapToRoadClass(): String { } } -private fun mapNames(names: List): List { - val namesNames = mutableListOf() +private fun mapNames(names: List): List { + val roadComponents = mutableListOf() names.forEach { - namesNames.add(it.mapToRoadName()) + roadComponents.add(it.mapToRoadComponent()) } - return namesNames.toList() + return roadComponents.toList() } -private fun com.mapbox.navigator.RoadName.mapToRoadName(): RoadName { - return RoadName( - name, - shielded +private fun com.mapbox.navigator.RoadName.mapToRoadComponent(): RoadComponent { + return RoadComponent( + text, + language, + shield.toMapboxShield(), + imageBaseUrl, ) } diff --git a/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/RoadName.kt b/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/RoadName.kt deleted file mode 100644 index 529f225f5d6..00000000000 --- a/libnavigation-base/src/main/java/com/mapbox/navigation/base/trip/model/eh/RoadName.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.mapbox.navigation.base.trip.model.eh - -/** - * Road name information - * - * **NOTE**: The Mapbox Electronic Horizon feature of the Mapbox Navigation SDK is in public beta - * and is subject to changes, including its pricing. Use of the feature is subject to the beta - * product restrictions in the Mapbox Terms of Service. - * Mapbox reserves the right to eliminate any free tier or free evaluation offers at any time and - * require customers to place an order to purchase the Mapbox Electronic Horizon feature, - * regardless of the level of use of the feature. - * - * @param name road name - * @param shielded is the road shielded? - */ -class RoadName internal constructor( - val name: String, - val shielded: Boolean -) { - - /** - * Regenerate whenever a change is made - */ - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (javaClass != other?.javaClass) return false - - other as RoadName - - if (name != other.name) return false - if (shielded != other.shielded) return false - - return true - } - - /** - * Regenerate whenever a change is made - */ - override fun hashCode(): Int { - var result = name.hashCode() - result = 31 * result + shielded.hashCode() - return result - } - - /** - * Returns a string representation of the object. - */ - override fun toString(): String { - return "NameInfo(" + - "name=$name, " + - "shielded=$shielded" + - ")" - } -} diff --git a/libnavigation-base/src/test/java/com/mapbox/navigation/base/internal/factory/RoadFactoryTest.kt b/libnavigation-base/src/test/java/com/mapbox/navigation/base/internal/factory/RoadFactoryTest.kt index a73ee9a8e0d..a7ae2ca50b8 100644 --- a/libnavigation-base/src/test/java/com/mapbox/navigation/base/internal/factory/RoadFactoryTest.kt +++ b/libnavigation-base/src/test/java/com/mapbox/navigation/base/internal/factory/RoadFactoryTest.kt @@ -44,8 +44,9 @@ class RoadFactoryTest { private fun createNavigationStatus(): NavigationStatus = mockk { every { roads } returns listOf( - com.mapbox.navigator.Road( + com.mapbox.navigator.RoadName( "roadName1", + "en", "legacyUrl1", com.mapbox.navigator.Shield( "designUrl", @@ -54,8 +55,9 @@ class RoadFactoryTest { "color" ) ), - com.mapbox.navigator.Road( + com.mapbox.navigator.RoadName( "roadName2", + "en", null, null ) diff --git a/libnavigation-core/src/test/java/com/mapbox/navigation/core/navigator/NavigatorMapperTest.kt b/libnavigation-core/src/test/java/com/mapbox/navigation/core/navigator/NavigatorMapperTest.kt index 58e7bb60664..44082ee4bfc 100644 --- a/libnavigation-core/src/test/java/com/mapbox/navigation/core/navigator/NavigatorMapperTest.kt +++ b/libnavigation-core/src/test/java/com/mapbox/navigation/core/navigator/NavigatorMapperTest.kt @@ -48,6 +48,7 @@ class NavigatorMapperTest { private val route: NavigationRoute = mockk(relaxed = true) { every { directionsRoute } returns this@NavigatorMapperTest.directionsRoute } + private val roadName = com.mapbox.navigator.RoadName("Central Av", "en", null, null) @OptIn(ExperimentalMapboxNavigationAPI::class) @Test @@ -128,7 +129,7 @@ class NavigatorMapperTest { ) } every { layer } returns null - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns false every { inTunnel } returns false } @@ -174,7 +175,7 @@ class NavigatorMapperTest { ) } every { layer } returns null - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns false every { inTunnel } returns false } @@ -220,7 +221,7 @@ class NavigatorMapperTest { ) } every { layer } returns null - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns true every { inTunnel } returns false } @@ -266,7 +267,7 @@ class NavigatorMapperTest { ) } every { layer } returns null - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns false every { inTunnel } returns false } @@ -305,7 +306,7 @@ class NavigatorMapperTest { every { matches } returns listOf() } every { layer } returns null - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns false every { inTunnel } returns false } @@ -355,7 +356,7 @@ class NavigatorMapperTest { ) } every { layer } returns 2 - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns false every { inTunnel } returns false } @@ -401,7 +402,7 @@ class NavigatorMapperTest { ) } every { layer } returns null - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { isFallback } returns false every { inTunnel } returns true } @@ -608,7 +609,7 @@ class NavigatorMapperTest { every { voiceInstruction } returns nativeVoiceInstructions every { inTunnel } returns true every { upcomingRouteAlerts } returns emptyList() - every { roads } returns listOf(com.mapbox.navigator.Road("Central Av", null, null)) + every { roads } returns listOf(roadName) every { locatedAlternativeRouteId } returns "alternative_id" every { geometryIndex } returns routeGeometryIndex every { shapeIndex } returns legGeometryIndex diff --git a/libnavigation-core/src/test/java/com/mapbox/navigation/core/telemetry/MapboxNavigationTelemetryTest.kt b/libnavigation-core/src/test/java/com/mapbox/navigation/core/telemetry/MapboxNavigationTelemetryTest.kt index 9ebde59d7f1..114f5450859 100644 --- a/libnavigation-core/src/test/java/com/mapbox/navigation/core/telemetry/MapboxNavigationTelemetryTest.kt +++ b/libnavigation-core/src/test/java/com/mapbox/navigation/core/telemetry/MapboxNavigationTelemetryTest.kt @@ -1419,12 +1419,14 @@ class MapboxNavigationTelemetryTest { every { telephonyManager.dataNetworkType } returns 5 every { telephonyManager.networkType } returns 6 - val activityManager = mockk() + val activityManager = mockk { + every { runningAppProcesses } returns listOf() + every { getRunningTasks(any()) } returns listOf() + every { getRunningServices(any()) } returns listOf() + } every { applicationContext.getSystemService(Context.ACTIVITY_SERVICE) } returns activityManager - every { activityManager.runningAppProcesses } returns listOf() - every { activityManager.getRunningTasks(any()) } returns listOf() } private fun initTelemetry() { diff --git a/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/internal/route/line/MapboxRouteLineUtilsRoboTest.kt b/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/internal/route/line/MapboxRouteLineUtilsRoboTest.kt index 5217aa6e071..1debea658b5 100644 --- a/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/internal/route/line/MapboxRouteLineUtilsRoboTest.kt +++ b/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/internal/route/line/MapboxRouteLineUtilsRoboTest.kt @@ -16,7 +16,6 @@ import com.mapbox.maps.Style import com.mapbox.maps.StyleObjectInfo import com.mapbox.maps.extension.style.layers.properties.generated.IconAnchor import com.mapbox.maps.extension.style.layers.properties.generated.IconPitchAlignment -import com.mapbox.maps.extension.style.sources.generated.GeoJsonSource import com.mapbox.maps.plugin.locationcomponent.LocationComponentConstants import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI import com.mapbox.navigation.base.route.NavigationRoute @@ -58,7 +57,6 @@ import com.mapbox.navigation.ui.maps.route.line.model.RouteLineColorResources import com.mapbox.navigation.ui.maps.testing.TestingUtil.loadNavigationRoute import io.mockk.every import io.mockk.mockk -import io.mockk.mockkObject import io.mockk.mockkStatic import io.mockk.slot import io.mockk.unmockkAll @@ -93,8 +91,6 @@ class MapboxRouteLineUtilsRoboTest { @OptIn(ExperimentalPreviewMapboxNavigationAPI::class) @Test fun initializeLayers() { - mockkObject(GeoJsonSource) - every { GeoJsonSource.directSetterEnabled() } returns false mockkStatic("com.mapbox.maps.extension.style.layers.LayerUtils") val options = MapboxRouteLineOptions.Builder(ctx) .withRouteLineBelowLayerId(LocationComponentConstants.MODEL_LAYER) diff --git a/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/route/arrow/RouteArrowUtilsRoboTest.kt b/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/route/arrow/RouteArrowUtilsRoboTest.kt index 231f582b3c4..fc77ca564ba 100644 --- a/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/route/arrow/RouteArrowUtilsRoboTest.kt +++ b/libnavui-maps/src/test/java/com/mapbox/navigation/ui/maps/route/arrow/RouteArrowUtilsRoboTest.kt @@ -8,12 +8,10 @@ import com.mapbox.bindgen.Value import com.mapbox.maps.Image import com.mapbox.maps.LayerPosition import com.mapbox.maps.Style -import com.mapbox.maps.extension.style.sources.generated.GeoJsonSource import com.mapbox.navigation.ui.maps.route.RouteLayerConstants import com.mapbox.navigation.ui.maps.route.arrow.model.RouteArrowOptions import io.mockk.every import io.mockk.mockk -import io.mockk.mockkObject import io.mockk.unmockkAll import io.mockk.verify import org.junit.After @@ -40,8 +38,6 @@ class RouteArrowUtilsRoboTest { @Test fun initializeLayers() { - mockkObject(GeoJsonSource) - every { GeoJsonSource.directSetterEnabled() } returns false val options = RouteArrowOptions.Builder(ctx).build() val shaftSourceValueSlots = mutableListOf() val headSourceValueSlots = mutableListOf() @@ -176,8 +172,6 @@ class RouteArrowUtilsRoboTest { @Test fun initializeLayers_whenCustomAboveLayerConfigured() { - mockkObject(GeoJsonSource) - every { GeoJsonSource.directSetterEnabled() } returns false val options = RouteArrowOptions.Builder(ctx).withAboveLayerId("foobar").build() val shaftSourceValueSlots = mutableListOf() val addStyleLayerSlots = mutableListOf() @@ -244,8 +238,6 @@ class RouteArrowUtilsRoboTest { @Test fun initializeLayers_whenAboveLayerNotExists() { - mockkObject(GeoJsonSource) - every { GeoJsonSource.directSetterEnabled() } returns false val mockImage = mockk(relaxed = true) val options = RouteArrowOptions.Builder(ctx).build() val shaftSourceValueSlots = mutableListOf() diff --git a/libtesting-thirdparty/src/main/java/com/mapbox/navigation/testing/factories/NativeFactories.kt b/libtesting-thirdparty/src/main/java/com/mapbox/navigation/testing/factories/NativeFactories.kt index e0f19caa437..04a47cc22b7 100644 --- a/libtesting-thirdparty/src/main/java/com/mapbox/navigation/testing/factories/NativeFactories.kt +++ b/libtesting-thirdparty/src/main/java/com/mapbox/navigation/testing/factories/NativeFactories.kt @@ -8,7 +8,7 @@ import com.mapbox.navigator.BannerSection import com.mapbox.navigator.FixLocation import com.mapbox.navigator.MapMatcherOutput import com.mapbox.navigator.NavigationStatus -import com.mapbox.navigator.Road +import com.mapbox.navigator.RoadName import com.mapbox.navigator.RouteInfo import com.mapbox.navigator.RouteInterface import com.mapbox.navigator.RouteState @@ -36,7 +36,7 @@ fun createNavigationStatus( geometryIndex: Int = 0, shapeIndex: Int = 0, intersectionIndex: Int = 0, - roads: List = emptyList(), + roads: List = emptyList(), voiceInstruction: VoiceInstruction? = null, // default banner instruction workarounds the direct usage of the MapboxNativeNavigatorImpl bannerInstruction: BannerInstruction? = createBannerInstruction(),