using injected matrix instance for the bug reporting to avoid directly calling getInstance

This commit is contained in:
Adam Brown 2022-02-08 15:38:04 +00:00
parent a63e79bad5
commit 8dc8c209d3
1 changed files with 3 additions and 2 deletions

View File

@ -73,7 +73,8 @@ class BugReporter @Inject constructor(
private val versionProvider: VersionProvider,
private val vectorPreferences: VectorPreferences,
private val vectorFileLogger: VectorFileLogger,
private val systemLocaleProvider: SystemLocaleProvider
private val systemLocaleProvider: SystemLocaleProvider,
private val matrix: Matrix
) {
var inMultiWindowMode = false
@ -265,7 +266,7 @@ class BugReporter @Inject constructor(
val builder = BugReporterMultipartBody.Builder()
.addFormDataPart("text", text)
.addFormDataPart("app", rageShakeAppNameForReport(reportType))
.addFormDataPart("user_agent", Matrix.getInstance(context).getUserAgent())
.addFormDataPart("user_agent", matrix.getUserAgent())
.addFormDataPart("user_id", userId)
.addFormDataPart("can_contact", canContact.toString())
.addFormDataPart("device_id", deviceId)