Skip to content

Commit f642c93

Browse files
committed
clean up user agent
1 parent 0d68bfe commit f642c93

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

gradle/dependencies.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ext {
1313
// version which we should use in this build
1414
def mapboxNavigatorVersion = System.getenv("FORCE_MAPBOX_NAVIGATION_NATIVE_VERSION")
1515
if (mapboxNavigatorVersion == null || mapboxNavigatorVersion == '') {
16-
mapboxNavigatorVersion = '124.0.1'
16+
mapboxNavigatorVersion = 'master-SNAPSHOT'
1717
}
1818
println("Navigation Native version: " + mapboxNavigatorVersion)
1919

libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt

+1-6
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ import kotlinx.coroutines.sync.withLock
153153
import java.lang.reflect.Field
154154
import java.util.Locale
155155

156-
private const val MAPBOX_NAVIGATION_USER_AGENT_BASE = "mapbox-navigation-android"
157156
private const val MAPBOX_NAVIGATION_TOKEN_EXCEPTION_ROUTER =
158157
"You need to provide an access token in NavigationOptions in order to use the default " +
159158
"Router."
@@ -546,7 +545,7 @@ class MapboxNavigation @VisibleForTesting internal constructor(
546545
MapboxMetricsReporter.init(
547546
navigationOptions.applicationContext,
548547
token,
549-
obtainUserAgent()
548+
USER_AGENT,
550549
)
551550
MapboxMetricsReporter.toggleLogging(navigationOptions.isDebugLoggingEnabled)
552551
}
@@ -1996,10 +1995,6 @@ class MapboxNavigation @VisibleForTesting internal constructor(
19961995
rerouteController?.interrupt()
19971996
}
19981997

1999-
private fun obtainUserAgent(): String {
2000-
return "$MAPBOX_NAVIGATION_USER_AGENT_BASE/${BuildConfig.MAPBOX_NAVIGATION_VERSION_NAME}"
2001-
}
2002-
20031998
private fun monitorNotificationActionButton(channel: ReceiveChannel<NotificationAction>) {
20041999
mainJobController.scope.monitorChannelWithException(
20052000
channel,

libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.mapbox.navigation.metrics
22

33
import android.content.Context
4+
import android.os.Handler
45
import com.google.gson.Gson
56
import com.mapbox.bindgen.Value
67
import com.mapbox.common.Event
@@ -66,7 +67,7 @@ object MapboxMetricsReporter : MetricsReporter {
6667
* Events priority. See [EventPriority]
6768
*/
6869
@Volatile
69-
var eventsPriority: EventPriority = EventPriority.QUEUED
70+
var eventsPriority: EventPriority = EventPriority.IMMEDIATE
7071

7172
/**
7273
* Initialize [EventsServiceInterface] and [TelemetryService] that need to send event to
@@ -80,10 +81,8 @@ object MapboxMetricsReporter : MetricsReporter {
8081
fun init(
8182
context: Context,
8283
accessToken: String,
83-
_userAgent: String
84+
userAgent: String
8485
) {
85-
// todo REMOVE
86-
val userAgent = "com.mapbox.onetap.app/v0.146.0-7-g8fc5f5c/1465 MapboxNavigationNative/123.2.0MapboxNavigationNative MapboxCommon/23.2.1 Android (13; r0s (SM-S901B))"
8786
isTelemetryInitialized = true
8887
val eventsServerOptions = EventsServerOptions(accessToken, userAgent, null)
8988
eventsService = EventsServiceProvider.provideEventsService(eventsServerOptions)

0 commit comments

Comments
 (0)