upgraded telem version (#11338)
* upgraded telem version * use telem method instead of Okhttp * use telem util in test
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.mapbox.mapboxsdk.http;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.os.Build;
|
||||
@@ -27,9 +26,10 @@ import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.internal.Util;
|
||||
import timber.log.Timber;
|
||||
|
||||
import static com.mapbox.services.android.telemetry.utils.TelemetryUtils.toHumanReadableAscii;
|
||||
|
||||
import static android.util.Log.DEBUG;
|
||||
import static android.util.Log.INFO;
|
||||
import static android.util.Log.WARN;
|
||||
@@ -204,7 +204,7 @@ class HTTPRequest implements Callback {
|
||||
|
||||
private String getUserAgent() {
|
||||
if (USER_AGENT_STRING == null) {
|
||||
return USER_AGENT_STRING = Util.toHumanReadableAscii(
|
||||
return USER_AGENT_STRING = toHumanReadableAscii(
|
||||
String.format("%s %s (%s) Android/%s (%s)",
|
||||
getApplicationIdentifier(),
|
||||
BuildConfig.MAPBOX_VERSION_STRING,
|
||||
|
||||
@@ -2,8 +2,7 @@ package com.mapbox.mapboxsdk.telemetry;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import okhttp3.internal.Util;
|
||||
|
||||
import static com.mapbox.services.android.telemetry.utils.TelemetryUtils.toHumanReadableAscii;
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
public class HttpTransportTest {
|
||||
@@ -15,6 +14,6 @@ public class HttpTransportTest {
|
||||
final String asciiVersion = "Sveriges Fj?ll/1.0/1 MapboxEventsAndroid/4.0.0-SNAPSHOT";
|
||||
|
||||
assertEquals("asciiVersion and swedishUserAgent should match", asciiVersion,
|
||||
Util.toHumanReadableAscii(swedishUserAgent));
|
||||
toHumanReadableAscii(swedishUserAgent));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ ext {
|
||||
versionCode = 11
|
||||
versionName = "5.0.0"
|
||||
|
||||
mapboxServicesVersion = "2.2.9"
|
||||
mapboxServicesVersion = "2.2.10"
|
||||
supportLibVersion = "25.4.0"
|
||||
espressoVersion = '3.0.1'
|
||||
testRunnerVersion = '1.0.1'
|
||||
|
||||
Reference in New Issue
Block a user