Skip to content

Commit

Permalink
fix user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
RingerJK committed Feb 27, 2023
1 parent 3a14852 commit fe9e2bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ import kotlinx.coroutines.sync.withLock
import java.lang.reflect.Field
import java.util.Locale

private const val MAPBOX_NAVIGATION_USER_AGENT_BASE = "mapbox-navigation-android"
private const val MAPBOX_NAVIGATION_TOKEN_EXCEPTION_ROUTER =
"You need to provide an access token in NavigationOptions in order to use the default " +
"Router."
Expand Down Expand Up @@ -546,7 +545,7 @@ class MapboxNavigation @VisibleForTesting internal constructor(
MapboxMetricsReporter.init(
navigationOptions.applicationContext,
token,
obtainUserAgent()
USER_AGENT,
)
MapboxMetricsReporter.toggleLogging(navigationOptions.isDebugLoggingEnabled)
}
Expand Down Expand Up @@ -2011,10 +2010,6 @@ class MapboxNavigation @VisibleForTesting internal constructor(
rerouteController?.interrupt()
}

private fun obtainUserAgent(): String {
return "$MAPBOX_NAVIGATION_USER_AGENT_BASE/${BuildConfig.MAPBOX_NAVIGATION_VERSION_NAME}"
}

private fun monitorNotificationActionButton(channel: ReceiveChannel<NotificationAction>) {
mainJobController.scope.monitorChannelWithException(
channel,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.navigation.metrics

import android.content.Context
import android.os.Handler
import com.google.gson.Gson
import com.mapbox.bindgen.Value
import com.mapbox.common.Event
Expand Down Expand Up @@ -66,7 +67,7 @@ object MapboxMetricsReporter : MetricsReporter {
* Events priority. See [EventPriority]
*/
@Volatile
var eventsPriority: EventPriority = EventPriority.QUEUED
var eventsPriority: EventPriority = EventPriority.IMMEDIATE

/**
* Initialize [EventsServiceInterface] and [TelemetryService] that need to send event to
Expand Down

0 comments on commit fe9e2bc

Please sign in to comment.