Add explicit dependency to okhttp (was provided by coil), and inject the OkHttpClient to DefaultBugReporter.
This commit is contained in:
parent
d651678718
commit
b68830faf1
2 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue