mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Include datastore settings in crash reports
This commit is contained in:
parent
02766b8014
commit
eb65ad124d
@ -3,5 +3,9 @@ package org.futo.inputmethod.latin
|
||||
import android.app.Application
|
||||
|
||||
class CrashLoggingApplication : Application() {
|
||||
companion object {
|
||||
fun logPreferences(preferences: Preferences) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -294,6 +294,12 @@ class LatinIME : InputMethodService(), LifecycleOwner, ViewModelStoreOwner, Save
|
||||
onNewSubtype(it[ActiveSubtype.key] ?: ActiveSubtype.default)
|
||||
}
|
||||
}
|
||||
|
||||
lifecycleScope.launch {
|
||||
dataStore.data.collect {
|
||||
CrashLoggingApplication.logPreferences(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
@ -2,6 +2,8 @@ package org.futo.inputmethod.latin
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import androidx.datastore.preferences.core.Preferences
|
||||
import org.acra.ACRA
|
||||
import org.acra.config.dialog
|
||||
import org.acra.config.httpSender
|
||||
import org.acra.config.mailSender
|
||||
@ -49,4 +51,12 @@ class CrashLoggingApplication : Application() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun logPreferences(preferences: Preferences) {
|
||||
preferences.asMap().forEach {
|
||||
ACRA.errorReporter.putCustomData(it.key.name, it.value.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user