Use the same name for the 2 db log methods

This commit is contained in:
Benoit Marty 2020-11-03 09:17:07 +01:00
parent 3c7f61e45c
commit d4963dfb31
3 changed files with 19 additions and 17 deletions

View File

@ -242,5 +242,5 @@ interface Session :
/**
* Maintenance API, allows to print outs info on DB size to logcat
*/
fun dbgTraceDbInfo()
fun logDbUsageInfo()
}

View File

@ -287,7 +287,7 @@ internal class DefaultSession @Inject constructor(
return "$myUserId - ${sessionParams.deviceId}"
}
override fun dbgTraceDbInfo() {
override fun logDbUsageInfo() {
Realm.getInstance(realmConfiguration).use { realm ->
val info = StringBuilder()

View File

@ -212,20 +212,20 @@ class BugReporter @Inject constructor(
}
activeSessionHolder.getSafeActiveSession()
?.takeIf { !mIsCancelled && withKeyRequestHistory }
?.cryptoService()
?.getGossipingEvents()
?.let { GossipingEventsSerializer().serialize(it) }
?.toByteArray()
?.let { rawByteArray ->
File(context.cacheDir.absolutePath, KEY_REQUESTS_FILENAME)
.also {
it.outputStream()
?.takeIf { !mIsCancelled && withKeyRequestHistory }
?.cryptoService()
?.getGossipingEvents()
?.let { GossipingEventsSerializer().serialize(it) }
?.toByteArray()
?.let { rawByteArray ->
File(context.cacheDir.absolutePath, KEY_REQUESTS_FILENAME)
.also {
it.outputStream()
.use { os -> os.write(rawByteArray) }
}
}
?.let { compressFile(it) }
?.let { gzippedFiles.add(it) }
}
}
?.let { compressFile(it) }
?.let { gzippedFiles.add(it) }
var deviceId = "undefined"
var userId = "undefined"
@ -446,8 +446,10 @@ class BugReporter @Inject constructor(
*/
fun openBugReportScreen(activity: FragmentActivity, forSuggestion: Boolean = false) {
screenshot = takeScreenshot(activity)
activeSessionHolder.getSafeActiveSession()?.dbgTraceDbInfo()
activeSessionHolder.getSafeActiveSession()?.cryptoService()?.logDbUsageInfo()
activeSessionHolder.getSafeActiveSession()?.let {
it.logDbUsageInfo()
it.cryptoService().logDbUsageInfo()
}
val intent = Intent(activity, BugReportActivity::class.java)
intent.putExtra("FOR_SUGGESTION", forSuggestion)