diff --git a/components/service/glean/build.gradle b/components/service/glean/build.gradle index 147ee04c3f2..4d83379961d 100644 --- a/components/service/glean/build.gradle +++ b/components/service/glean/build.gradle @@ -53,7 +53,6 @@ dependencies { implementation project(':support-ktx') implementation project(':support-base') implementation project(':concept-fetch') - implementation project(':lib-fetch-httpurlconnection') implementation project(':support-utils') testImplementation Dependencies.androidx_test_core @@ -65,6 +64,7 @@ dependencies { testImplementation Dependencies.androidx_work_testing testImplementation project(':support-test') + testImplementation project(':lib-fetch-httpurlconnection') testImplementation project(':lib-fetch-okhttp') testImplementation GLEAN_LIBRARY_FORUNITTESTS diff --git a/components/service/glean/src/main/java/mozilla/components/service/glean/config/Configuration.kt b/components/service/glean/src/main/java/mozilla/components/service/glean/config/Configuration.kt index 21a5fdc4805..72bb3576f42 100644 --- a/components/service/glean/src/main/java/mozilla/components/service/glean/config/Configuration.kt +++ b/components/service/glean/src/main/java/mozilla/components/service/glean/config/Configuration.kt @@ -4,7 +4,6 @@ package mozilla.components.service.glean.config -import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient import mozilla.components.service.glean.net.ConceptFetchHttpUploader import mozilla.telemetry.glean.net.PingUploader import mozilla.telemetry.glean.config.Configuration as GleanCoreConfiguration @@ -23,7 +22,7 @@ data class Configuration @JvmOverloads constructor ( val serverEndpoint: String = DEFAULT_TELEMETRY_ENDPOINT, val channel: String? = null, val maxEvents: Int? = null, - val httpClient: PingUploader = ConceptFetchHttpUploader(lazy { HttpURLConnectionClient() }) + val httpClient: PingUploader? = null ) { // The following is required to support calling our API from Java. companion object { @@ -37,6 +36,12 @@ data class Configuration @JvmOverloads constructor ( * @return a [mozilla.telemetry.glean.config.Configuration] instance. */ fun toWrappedConfiguration(): GleanCoreConfiguration { - return GleanCoreConfiguration(serverEndpoint, channel, maxEvents, httpClient) + // Only pass on the HTTP client if one was configured, + // otherwise fall back to the default in Glean core. + if (httpClient != null) { + return GleanCoreConfiguration(serverEndpoint, channel, maxEvents, httpClient) + } else { + return GleanCoreConfiguration(serverEndpoint, channel, maxEvents) + } } }