Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.5.0-rc.1 #7886

Merged
merged 1 commit into from
Oct 31, 2024
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
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog for the Mapbox Navigation SDK Core Framework for Android

## Navigation SDK Core Framework 3.5.0-rc.1 - 26 October, 2024
#### Features


#### Bug fixes and improvements
- Improved reroute and alternative routes behavior [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)
- Fixed map matching bug after leaving a tunnel [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)
- Increased route stickiness in dead reckoning mode [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)
- Added ability to send raw unfused GNSS location in addition to fused one [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)
- Improved odometry and road graph fusing in urban canyons [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)
- Signature of experimental `RawGnssSatelliteData` has been changed, now it requires `residual` as a constructor parameter [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)
- Experimental `RawGnssLocation` type has been removed, now `RawGnssData` requires `DilutionOfPrecision` as a parameter [#7114](https://github.com/mapbox/mapbox-navigation-android/pull/7114)

#### Known issues :warning:


#### Other changes


### Mapbox dependencies
This release depends on, and has been tested with, the following Mapbox dependencies:
- Mapbox Maps SDK `v11.8.0-rc.1` ([release notes](https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.8.0-rc.1))
- Mapbox Navigation Native `v321.0.0-rc.1`
- Mapbox Core Common `v24.8.0-rc.1`
- Mapbox Java `v7.3.1` ([release notes](https://github.com/mapbox/mapbox-java/releases/tag/v7.3.1))


## Navigation SDK Core Framework 3.5.0-beta.1 - 17 October, 2024
#### Features
- Added support for SVG junction views, see `MapboxJunctionApi#generateJunction(instructions: BannerInstructions, @JunctionViewFormat format: String, consumer: MapboxNavigationConsumer<Expected<JunctionError, JunctionViewData>>)`. [#6803](https://github.com/mapbox/mapbox-navigation-android/pull/6803)
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @mapbox/navigation-android
8 changes: 4 additions & 4 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ ext {
// version which we should use in this build
def mapboxNavigatorVersion = System.getenv("FORCE_MAPBOX_NAVIGATION_NATIVE_VERSION")
if (mapboxNavigatorVersion == null || mapboxNavigatorVersion == '') {
mapboxNavigatorVersion = '321.0.0-beta.1'
mapboxNavigatorVersion = '321.0.0-rc.1'
}
println("Navigation Native version: " + mapboxNavigatorVersion)

version = [
mapboxMapSdk : '11.8.0-beta.1',
mapboxMapSdk : '11.8.0-rc.1',
mapboxSdkServices : '7.3.1',
mapboxNavigator : "${mapboxNavigatorVersion}",
mapboxCommonNative : '24.8.0-beta.1',
mapboxSearch : '2.6.0-beta.1',
mapboxCommonNative : '24.8.0-rc.1',
mapboxSearch : '2.6.0-rc.1',
mapboxBaseAndroid : '0.11.0',
androidXLifecycle : '2.4.0',
androidXCoreVersion : '1.6.0',
Expand Down
3 changes: 1 addition & 2 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ registry {
sdkName = project.ext.navSdkArtifactSettings[project.name].getV2()
production = true
snapshot = project.ext.snapshot
// TODO revert override = snapshot
override = true
override = snapshot
dryRun = false
publish = true
publishMessage = "cc @mapbox/navigation-android"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ class CoreMapMatchingTests : BaseCoreNoCleanUpTest() {
val result = navigation.requestMapMatching(options).getSuccessfulOrThrowException()
navigation.setNavigationRoutes(result.navigationRoutes)
stayOnPosition(
latitude = 32.712012,
longitude = -117.172928,
latitude = 32.712702672167055,
longitude = -117.17290808578423,
bearing = 178.0f,
frequencyHz = 5,
) {
Expand Down Expand Up @@ -354,8 +354,8 @@ class CoreMapMatchingTests : BaseCoreNoCleanUpTest() {

navigation.setNavigationRoutes(listOf(deserializedRoute))
stayOnPosition(
latitude = 32.712012,
longitude = -117.172928,
latitude = 32.712702672167055,
longitude = -117.17290808578423,
bearing = 178.0f,
frequencyHz = 5,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ internal object HistoryAttachmentsUtils {
.replace('_', '/'),
).getString("u")

fun generateSessionId(copilotSession: CopilotSession, owner: String): String =
"$COPILOT/$owner/${retrieveSpecVersion()}/" +
fun generateSessionId(copilotSession: CopilotSession): String =
"$COPILOT/${copilotSession.owner}/${retrieveSpecVersion()}/" +
"${copilotSession.appMode}/-/-" +
"/${copilotSession.driveMode}/-" +
"/${copilotSession.driveId}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ package com.mapbox.navigation.copilot.internal
import android.content.Context
import android.content.pm.ApplicationInfo
import com.google.gson.Gson
import com.mapbox.common.MapboxServices
import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
import com.mapbox.navigation.base.internal.options.getOwner
import com.mapbox.navigation.base.internal.utils.MapboxOptionsUtil.getTokenForService
import com.mapbox.navigation.base.options.EventsAppMetadata
import com.mapbox.navigation.base.options.NavigationOptions
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.retrieveNavNativeSdkVersion
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.retrieveNavSdkVersion
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.retrieveOwnerFrom
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.utcTimeNow
import java.io.File
import java.util.Locale
Expand Down Expand Up @@ -41,6 +45,7 @@ data class CopilotSession(
val appUserId: String = "_",
val appSessionId: String = "_",
val recording: String = "",
val owner: String = "",
) {
fun toJson(): String = Gson().toJson(this)

Expand Down Expand Up @@ -69,6 +74,8 @@ data class CopilotSession(
appUserId = copilotOptions.userId ?: eventsAppMetadata?.userId ?: "_",
appSessionId = eventsAppMetadata?.sessionId ?: "_",
recording = recording,
owner = copilotOptions.getOwner()?.takeUnless { it.isBlank() }
?: retrieveOwnerFrom(getTokenForService(MapboxServices.DIRECTIONS)),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.WorkerParameters
import com.mapbox.common.MapboxOptions
import com.mapbox.common.MapboxServices
import com.mapbox.common.TransferState
import com.mapbox.common.UploadOptions
import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
import com.mapbox.navigation.base.internal.utils.MapboxOptionsUtil.getTokenForService
import com.mapbox.navigation.copilot.AttachmentMetadata
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.attachmentFilename
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.generateSessionId
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.rename
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.retrieveOwnerFrom
import com.mapbox.navigation.copilot.HttpServiceProvider
import com.mapbox.navigation.copilot.MapboxCopilot
import com.mapbox.navigation.copilot.MapboxCopilot.pushStatusObservers
Expand Down Expand Up @@ -106,8 +103,6 @@ internal class HistoryUploadWorker(
HistoryAttachmentsUtils.delete(file)
}

@Suppress("MaxLineLength")
/* ktlint-disable max-line-length */
private suspend fun uploadHistoryFile(
uploadOptions: UploadOptions,
): Boolean = suspendCancellableCoroutine { cont ->
Expand All @@ -120,7 +115,8 @@ internal class HistoryUploadWorker(

TransferState.IN_PROGRESS -> {
logD(
"uploadStatus state = UPLOADING sent ${uploadStatus.totalSentBytes}/${uploadStatus.totalBytes} bytes",
"uploadStatus state = UPLOADING sent ${uploadStatus.totalSentBytes}" +
"/${uploadStatus.totalBytes} bytes",
)
}

Expand All @@ -132,7 +128,8 @@ internal class HistoryUploadWorker(

TransferState.FAILED -> {
logD(
"uploadStatus state = FAILED error = ${uploadStatus.error}; HttpResponseData = ${uploadStatus.httpResult?.value}",
"uploadStatus state = FAILED error = ${uploadStatus.error}; " +
"HttpResponseData = ${uploadStatus.httpResult?.value}",
)
cont.resume(false)
}
Expand All @@ -144,7 +141,6 @@ internal class HistoryUploadWorker(
}
}
}
/* ktlint-enable max-line-length */

private fun failure(copilotSession: CopilotSession) {
val failedStatus = PushStatus.Failed(copilotSession)
Expand All @@ -166,19 +162,20 @@ internal class HistoryUploadWorker(

internal companion object {

private const val HISTORY_FILE_PATH: String = "history_file_path"
private const val APP_MODE: String = "app_mode"
private const val DRIVE_MODE: String = "drive_mode"
private const val DRIVE_ID: String = "drive_id"
private const val STARTED_AT: String = "started_at"
private const val ENDED_AT: String = "ended_at"
private const val NAV_SDK_VERSION: String = "nav_sdk_version"
private const val NAV_NATIVE_SDK_VERSION: String = "nav_native_sdk_version"
private const val APP_VERSION: String = "app_version"
private const val APP_USER_ID: String = "app_user_id"
private const val APP_SESSION_ID: String = "app_session_id"
private const val UPLOAD_URL: String = "upload_url"
private const val UPLOAD_SESSION_ID: String = "upload_session_id"
private const val HISTORY_FILE_PATH = "history_file_path"
private const val APP_MODE = "app_mode"
private const val DRIVE_MODE = "drive_mode"
private const val DRIVE_ID = "drive_id"
private const val STARTED_AT = "started_at"
private const val ENDED_AT = "ended_at"
private const val NAV_SDK_VERSION = "nav_sdk_version"
private const val NAV_NATIVE_SDK_VERSION = "nav_native_sdk_version"
private const val APP_VERSION = "app_version"
private const val APP_USER_ID = "app_user_id"
private const val APP_SESSION_ID = "app_session_id"
private const val UPLOAD_URL = "upload_url"
private const val UPLOAD_SESSION_ID = "upload_session_id"
private const val OWNER = "owner"

// 2^8 x 338 = 86528 / 3600 = 24.03 hours
private const val MAX_RUN_ATTEMPT_COUNT = 8
Expand Down Expand Up @@ -208,8 +205,7 @@ internal class HistoryUploadWorker(

private fun inputData(copilotSession: CopilotSession): Data {
val url = "$PROD_BASE_URL/attachments/v1?access_token=${MapboxOptions.accessToken}"
val owner = retrieveOwnerFrom(getTokenForService(MapboxServices.DIRECTIONS))
val uploadSessionId = generateSessionId(copilotSession, owner)
val uploadSessionId = generateSessionId(copilotSession)

return Data.Builder()
.putCopilotSession(copilotSession)
Expand All @@ -230,6 +226,7 @@ internal class HistoryUploadWorker(
appUserId = data.getString(APP_USER_ID)!!,
appSessionId = data.getString(APP_SESSION_ID)!!,
recording = data.getString(HISTORY_FILE_PATH)!!,
owner = data.getString(OWNER).orEmpty(),
)

@VisibleForTesting
Expand All @@ -245,5 +242,6 @@ internal class HistoryUploadWorker(
.putString(APP_VERSION, copilotSession.appVersion)
.putString(APP_SESSION_ID, copilotSession.appSessionId)
.putString(HISTORY_FILE_PATH, copilotSession.recording)
.putString(OWNER, copilotSession.owner)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ class HistoryAttachmentsUtilsTest {
appVersion = "v0.108.0-9-g0527ee4",
appUserId = "wBzYwfK0oCYMTNYPIFHhYuYOLLs1",
appSessionId = "3e48fd7b-ac82-42a8-9abe-aaeb724f92ce",
owner = "owner",
)

val sessionId = HistoryAttachmentsUtils.generateSessionId(navigationSession, "owner")
val sessionId = HistoryAttachmentsUtils.generateSessionId(navigationSession)

val expectedSessionId = "co-pilot/owner/1.2/mbx-debug/-/-/free-drive/" +
"-/3e48fd7a-fc82-42a8-9bae-baeb724f92ce"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class MapboxCopilotImplTest {

mockkObject(HistoryAttachmentsUtils)
every { HistoryAttachmentsUtils.delete(any()) } returns false
every { HistoryAttachmentsUtils.retrieveOwnerFrom(fakeAccessToken) } returns "owner"

val tmpFolder = folder.newFolder("copilot-test")
mockedContext = mockk<Application>(relaxed = true) {
Expand Down
4 changes: 4 additions & 0 deletions libnavigation-core/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ package com.mapbox.navigation.core.arrival {

package com.mapbox.navigation.core.directions.session {

public final class DirectionsSessionKt {
}

public final class IgnoredRoute {
method public com.mapbox.navigation.base.route.NavigationRoute getNavigationRoute();
method public String getReason();
Expand Down Expand Up @@ -1271,6 +1274,7 @@ package com.mapbox.navigation.core.trip.session.eh {
method public void matchPolylineObjects(java.util.List<com.mapbox.navigation.base.trip.model.eh.MatchableGeometry> matchableGeometries, boolean useOnlyPreloadedTiles = false);
method public void matchPolylineObjects(java.util.List<com.mapbox.navigation.base.trip.model.eh.MatchableGeometry> matchableGeometries);
method public void registerRoadObjectMatcherObserver(com.mapbox.navigation.core.trip.session.eh.RoadObjectMatcherObserver roadObjectMatcherObserver);
method public void unregisterRoadObjectMatcherObserver(com.mapbox.navigation.core.trip.session.eh.RoadObjectMatcherObserver roadObjectMatcherObserver);
}

public final class RoadObjectMatcherKt {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.navigation.core.reroute

import com.google.gson.JsonPrimitive
import com.mapbox.api.directions.v5.DirectionsCriteria.PROFILE_DRIVING_TRAFFIC
import com.mapbox.api.directions.v5.models.RouteOptions
import com.mapbox.navigation.base.ExperimentalMapboxNavigationAPI
import com.mapbox.navigation.base.route.ResponseOriginAPI.Companion.DIRECTIONS_API
Expand Down Expand Up @@ -40,7 +41,8 @@ internal class RouteHistoryOptionsAdapter(
val routeProgress = latestRouteProgressProvider()
return if (routeProgress != null &&
routeProgress.navigationRoute.origin == RouterOrigin.ONLINE &&
routeProgress.navigationRoute.responseOriginAPI == DIRECTIONS_API
routeProgress.navigationRoute.responseOriginAPI == DIRECTIONS_API &&
routeOptions.profile() == PROFILE_DRIVING_TRAFFIC
) {
addCurrentRouteToHistory(routeProgress, routeOptions)
} else {
Expand Down
Loading
Loading