From 8dc8c209d327e4642c15c464190c72b3e5863fac Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 8 Feb 2022 15:38:04 +0000 Subject: [PATCH] using injected matrix instance for the bug reporting to avoid directly calling getInstance --- .../java/im/vector/app/features/rageshake/BugReporter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt b/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt index 2c554716d2..b6454b89e4 100755 --- a/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt +++ b/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt @@ -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)