mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add explicit dependency to okhttp (was provided by coil), and inject the OkHttpClient to DefaultBugReporter.
This commit is contained in:
committed by
Benoit Marty
parent
771855dfe3
commit
0d73b962c2
@@ -43,6 +43,8 @@ dependencies {
|
|||||||
api(libs.squareup.seismic)
|
api(libs.squareup.seismic)
|
||||||
api(projects.features.rageshake.api)
|
api(projects.features.rageshake.api)
|
||||||
implementation(libs.androidx.datastore.preferences)
|
implementation(libs.androidx.datastore.preferences)
|
||||||
|
implementation(platform(libs.network.okhttp.bom))
|
||||||
|
implementation("com.squareup.okhttp3:okhttp")
|
||||||
implementation(libs.coil)
|
implementation(libs.coil)
|
||||||
implementation(libs.coil.compose)
|
implementation(libs.coil.compose)
|
||||||
ksp(libs.showkase.processor)
|
ksp(libs.showkase.processor)
|
||||||
|
|||||||
+2
-4
@@ -64,6 +64,7 @@ class DefaultBugReporter @Inject constructor(
|
|||||||
private val screenshotHolder: ScreenshotHolder,
|
private val screenshotHolder: ScreenshotHolder,
|
||||||
private val crashDataStore: CrashDataStore,
|
private val crashDataStore: CrashDataStore,
|
||||||
private val coroutineDispatchers: CoroutineDispatchers,
|
private val coroutineDispatchers: CoroutineDispatchers,
|
||||||
|
private val okHttpClient: OkHttpClient,
|
||||||
/*
|
/*
|
||||||
private val activeSessionHolder: ActiveSessionHolder,
|
private val activeSessionHolder: ActiveSessionHolder,
|
||||||
private val versionProvider: VersionProvider,
|
private val versionProvider: VersionProvider,
|
||||||
@@ -88,9 +89,6 @@ class DefaultBugReporter @Inject constructor(
|
|||||||
private const val BUFFER_SIZE = 1024 * 1024 * 50
|
private const val BUFFER_SIZE = 1024 * 1024 * 50
|
||||||
}
|
}
|
||||||
|
|
||||||
// the http client
|
|
||||||
private val mOkHttpClient = OkHttpClient()
|
|
||||||
|
|
||||||
// the pending bug report call
|
// the pending bug report call
|
||||||
private var mBugReportCall: Call? = null
|
private var mBugReportCall: Call? = null
|
||||||
|
|
||||||
@@ -346,7 +344,7 @@ class DefaultBugReporter @Inject constructor(
|
|||||||
|
|
||||||
// trigger the request
|
// trigger the request
|
||||||
try {
|
try {
|
||||||
mBugReportCall = mOkHttpClient.newCall(request)
|
mBugReportCall = okHttpClient.newCall(request)
|
||||||
response = mBugReportCall!!.execute()
|
response = mBugReportCall!!.execute()
|
||||||
responseCode = response.code
|
responseCode = response.code
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|||||||
Reference in New Issue
Block a user