Skip to content

Commit ad9cad3

Browse files
dzinadgithub-actions[bot]
authored andcommitted
bump mapbox-sdk to 8b7e0db
GitOrigin-RevId: ec7e5d4d733bf705a26a82ea5772d287f9b9dac7
1 parent 6135437 commit ad9cad3

File tree

3 files changed

+206
-4
lines changed

3 files changed

+206
-4
lines changed

gradle/dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ext {
88
carMinSdkVersion : 23
99
]
1010

11-
def mapboxSdkVersionSuffix = '14.0-beta.1'
11+
def mapboxSdkVersionSuffix = '15.0-SNAPSHOT-07-11--04-32.git-8b7e0db'
1212

1313
def ndkVersionSuffix = ""
1414
if (project.hasProperty("ndkMajor")) {
@@ -34,7 +34,7 @@ ext {
3434
mapboxNavigator : "${mapboxNavigatorVersion}",
3535
mapboxCommonNative : "24.${mapboxSdkVersionSuffix}",
3636
mapboxNavSdkCpp : "0.${mapboxSdkVersionSuffix}",
37-
mapboxSearch : '2.14.0-beta.1',
37+
mapboxSearch : '2.15.0-8b7e0db-SNAPSHOT',
3838
mapboxBaseAndroid : '0.11.0',
3939
androidXActivity : '1.7.1',
4040
androidXActivityCompose : '1.9.2',

navigation/src/main/java/com/mapbox/navigation/core/adas/AdasEdgeAttributes.kt

Lines changed: 200 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.mapbox.navigation.core.adas
22

3+
import androidx.annotation.IntDef
34
import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
45

56
/**
@@ -14,13 +15,18 @@ import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
1415
* Position is a shape index, where integer part in an index of geometry segment is
1516
* and fractional part is a position on the segment
1617
* @param isDividedRoad A flag indicating if the edge is a divided road
18+
* @param formOfWay Form Of Way information from ADAS tiles, may differ from the Valhalla value, but should be used for ADAS purposes.
19+
* See [FormOfWay.Type]. If not set, then the value is not known
20+
* @param etc2 Road class in ETC2.0 format (Japan specific), see [Etc2Road.Type]
1721
*/
1822
@ExperimentalPreviewMapboxNavigationAPI
1923
class AdasEdgeAttributes private constructor(
2024
val speedLimit: List<AdasSpeedLimitInfo>,
2125
val slopes: List<AdasValueOnEdge>,
2226
val curvatures: List<AdasValueOnEdge>,
2327
val isDividedRoad: Boolean?,
28+
@FormOfWay.Type val formOfWay: Int?,
29+
@Etc2Road.Type val etc2: Int,
2430
) {
2531

2632
/**
@@ -35,7 +41,10 @@ class AdasEdgeAttributes private constructor(
3541
if (speedLimit != other.speedLimit) return false
3642
if (slopes != other.slopes) return false
3743
if (curvatures != other.curvatures) return false
38-
return isDividedRoad == other.isDividedRoad
44+
if (isDividedRoad != other.isDividedRoad) return false
45+
if (formOfWay != other.formOfWay) return false
46+
if (etc2 != other.etc2) return false
47+
return true
3948
}
4049

4150
/**
@@ -46,6 +55,8 @@ class AdasEdgeAttributes private constructor(
4655
result = 31 * result + slopes.hashCode()
4756
result = 31 * result + curvatures.hashCode()
4857
result = 31 * result + isDividedRoad.hashCode()
58+
result = 31 * result + formOfWay.hashCode()
59+
result = 31 * result + etc2.hashCode()
4960
return result
5061
}
5162

@@ -57,10 +68,195 @@ class AdasEdgeAttributes private constructor(
5768
"speedLimit=$speedLimit, " +
5869
"slopes=$slopes, " +
5970
"curvatures=$curvatures, " +
60-
"isDividedRoad=$isDividedRoad" +
71+
"isDividedRoad=$isDividedRoad, " +
72+
"formOfWay=$formOfWay, " +
73+
"etc2=$etc2" +
6174
")"
6275
}
6376

77+
/**
78+
* Form of way type.
79+
*/
80+
object FormOfWay {
81+
82+
/**
83+
* Unknown form of way.
84+
*/
85+
const val UNKNOWN = 0
86+
87+
/**
88+
* Freeway form of way.
89+
*/
90+
const val FREEWAY = 1
91+
92+
/**
93+
* Multiple carriageway form of way.
94+
*/
95+
const val MULTIPLE_CARRIAGEWAY = 2
96+
97+
/**
98+
* Single carriageway form of way.
99+
*/
100+
const val SINGLE_CARRIAGEWAY = 3
101+
102+
/**
103+
* Roundabout circle form of way.
104+
*/
105+
const val ROUNDABOUT_CIRCLE = 4
106+
107+
/**
108+
* Traffic square form of way.
109+
*/
110+
const val TRAFFIC_SQUARE = 5
111+
112+
/**
113+
* Slip road form of way.
114+
*/
115+
const val SLIP_ROAD = 6
116+
117+
/**
118+
* Parallel road form of way.
119+
*/
120+
const val PARALLEL_ROAD = 7
121+
122+
/**
123+
* Ramp on freeway form of way.
124+
*/
125+
const val RAMP_ON_FREEWAY = 8
126+
127+
/**
128+
* Ramp form of way.
129+
*/
130+
const val RAMP = 9
131+
132+
/**
133+
* Service road form of way.
134+
*/
135+
const val SERVICE_ROAD = 10
136+
137+
/**
138+
* Car park entrance form of way.
139+
*/
140+
const val CAR_PARK_ENTRANCE = 11
141+
142+
/**
143+
* Service entrance form of way.
144+
*/
145+
const val SERVICE_ENTRANCE = 12
146+
147+
/**
148+
* Pedestrian zone form of way.
149+
*/
150+
const val PEDESTRIAN_ZONE = 13
151+
152+
/**
153+
* Form of way is not applicable.
154+
*/
155+
const val NA = 14
156+
157+
/**
158+
* Retention policy for [FormOfWay].
159+
*/
160+
@Retention(AnnotationRetention.BINARY)
161+
@IntDef(
162+
UNKNOWN,
163+
FREEWAY,
164+
MULTIPLE_CARRIAGEWAY,
165+
SINGLE_CARRIAGEWAY,
166+
ROUNDABOUT_CIRCLE,
167+
TRAFFIC_SQUARE,
168+
SLIP_ROAD,
169+
PARALLEL_ROAD,
170+
RAMP_ON_FREEWAY,
171+
RAMP,
172+
SERVICE_ROAD,
173+
CAR_PARK_ENTRANCE,
174+
SERVICE_ENTRANCE,
175+
PEDESTRIAN_ZONE,
176+
NA,
177+
)
178+
annotation class Type
179+
180+
@Type
181+
@JvmSynthetic
182+
internal fun createFromNativeObject(nativeObj: com.mapbox.navigator.FormOfWay): Int =
183+
when (nativeObj) {
184+
com.mapbox.navigator.FormOfWay.FREEWAY -> FREEWAY
185+
com.mapbox.navigator.FormOfWay.MULTIPLE_CARRIAGEWAY -> MULTIPLE_CARRIAGEWAY
186+
com.mapbox.navigator.FormOfWay.SINGLE_CARRIAGEWAY -> SINGLE_CARRIAGEWAY
187+
com.mapbox.navigator.FormOfWay.ROUNDABOUT_CIRCLE -> ROUNDABOUT_CIRCLE
188+
com.mapbox.navigator.FormOfWay.TRAFFIC_SQUARE -> TRAFFIC_SQUARE
189+
com.mapbox.navigator.FormOfWay.SLIP_ROAD -> SLIP_ROAD
190+
com.mapbox.navigator.FormOfWay.PARALLEL_ROAD -> PARALLEL_ROAD
191+
com.mapbox.navigator.FormOfWay.RAMP_ON_FREEWAY -> RAMP_ON_FREEWAY
192+
com.mapbox.navigator.FormOfWay.RAMP -> RAMP
193+
com.mapbox.navigator.FormOfWay.SERVICE_ROAD -> SERVICE_ROAD
194+
com.mapbox.navigator.FormOfWay.CAR_PARK_ENTRANCE -> CAR_PARK_ENTRANCE
195+
com.mapbox.navigator.FormOfWay.SERVICE_ENTRANCE -> SERVICE_ENTRANCE
196+
com.mapbox.navigator.FormOfWay.PEDESTRIAN_ZONE -> PEDESTRIAN_ZONE
197+
com.mapbox.navigator.FormOfWay.NA -> NA
198+
com.mapbox.navigator.FormOfWay.UNKNOWN -> UNKNOWN
199+
}
200+
}
201+
202+
/**
203+
* ETC2 road type.
204+
*/
205+
object Etc2Road {
206+
207+
/**
208+
* Unknown ETC2 road type.
209+
*/
210+
const val UNKNOWN = 0
211+
212+
/**
213+
* Highway ETC2 road type.
214+
*/
215+
const val HIGHWAY = 1
216+
217+
/**
218+
* City highway ETC2 road type.
219+
*/
220+
const val CITY_HIGHWAY = 2
221+
222+
/**
223+
* Normal road ETC2 road type.
224+
*/
225+
const val NORMAL_ROAD = 3
226+
227+
/**
228+
* Other ETC2 road type.
229+
*/
230+
const val OTHER = 4
231+
232+
/**
233+
* Retention policy for the [Etc2Road.Type].
234+
*/
235+
@Retention(AnnotationRetention.BINARY)
236+
@IntDef(
237+
UNKNOWN,
238+
HIGHWAY,
239+
CITY_HIGHWAY,
240+
NORMAL_ROAD,
241+
OTHER,
242+
)
243+
annotation class Type
244+
245+
@Type
246+
@JvmSynthetic
247+
internal fun createFromNativeObject(
248+
nativeObj: com.mapbox.navigator.ETC2RoadType,
249+
): Int {
250+
return when (nativeObj) {
251+
com.mapbox.navigator.ETC2RoadType.HIGHWAY -> HIGHWAY
252+
com.mapbox.navigator.ETC2RoadType.CITY_HIGHWAY -> CITY_HIGHWAY
253+
com.mapbox.navigator.ETC2RoadType.NORMAL_ROAD -> NORMAL_ROAD
254+
com.mapbox.navigator.ETC2RoadType.OTHER -> OTHER
255+
com.mapbox.navigator.ETC2RoadType.UNKNOWN -> UNKNOWN
256+
}
257+
}
258+
}
259+
64260
internal companion object {
65261

66262
@JvmSynthetic
@@ -76,6 +272,8 @@ class AdasEdgeAttributes private constructor(
76272
AdasValueOnEdge.createFromNativeObject(it)
77273
},
78274
isDividedRoad = nativeObj.isDividedRoad,
275+
formOfWay = nativeObj.formOfWay?.let { FormOfWay.createFromNativeObject(it) },
276+
etc2 = Etc2Road.createFromNativeObject(nativeObj.etc2),
79277
)
80278
}
81279
}

navigation/src/test/java/com/mapbox/navigation/core/adas/AdasEdgeAttributesTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class AdasEdgeAttributesTest {
2525
listOf(AdasTypeFactory.NATIVE_VALUE_ON_EDGE_1),
2626
listOf(AdasTypeFactory.NATIVE_VALUE_ON_EDGE_2),
2727
true,
28+
com.mapbox.navigator.FormOfWay.CAR_PARK_ENTRANCE,
29+
com.mapbox.navigator.ETC2RoadType.HIGHWAY,
2830
)
2931

3032
val platform = AdasEdgeAttributes.createFromNativeObject(native)
@@ -33,5 +35,7 @@ class AdasEdgeAttributesTest {
3335
assertEquals(listOf(AdasTypeFactory.VALUE_ON_EDGE_1), platform.slopes)
3436
assertEquals(listOf(AdasTypeFactory.VALUE_ON_EDGE_2), platform.curvatures)
3537
assertEquals(true, platform.isDividedRoad)
38+
assertEquals(AdasEdgeAttributes.FormOfWay.CAR_PARK_ENTRANCE, platform.formOfWay)
39+
assertEquals(AdasEdgeAttributes.Etc2Road.HIGHWAY, platform.etc2)
3640
}
3741
}

0 commit comments

Comments
 (0)