Skip to content

Commit

Permalink
Automatic merge branch 'current-stable' into 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto CI committed Jan 7, 2023
2 parents c67a456 + ecb0e44 commit 11eeb54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 2 additions & 11 deletions app/src/main/java/net/bible/android/BibleApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ open class BibleApplication : Application() {
val defaultExceptionHandler = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler { t, e ->
BugReport.saveScreenshot()
logBasicInfo()
BugReport.saveLogcat()
CommonUtils.realSharedPreferences.edit().putBoolean("app-crashed", true).commit()
defaultExceptionHandler.uncaughtException(t, e)
Expand All @@ -112,7 +111,8 @@ open class BibleApplication : Application() {

LocaleProviderManager.setLocaleProvider(MyLocaleProvider)

logBasicInfo()
logSqliteVersion()

// This must be done before accessing JSword to prevent default folders being used
SwordEnvironmentInitialisation.initialiseJSwordFolders()

Expand All @@ -133,15 +133,6 @@ open class BibleApplication : Application() {
localeOverrideAtStartUp = LocaleHelper.getOverrideLanguage(this)
}

private fun logBasicInfo() {
Log.i(TAG, "OS:" + System.getProperty("os.name") + " ver " + System.getProperty("os.version"))
Log.i(TAG, "Java:" + System.getProperty("java.vendor") + " ver " + System.getProperty("java.version"))
Log.i(TAG, "Java home:" + System.getProperty("java.home")!!)
Log.i(TAG, "User dir:" + System.getProperty("user.dir") + " Timezone:" + System.getProperty("user.timezone"))
logSqliteVersion()
Log.i(TAG, BugReport.createErrorText())
}

var sqliteVersion = ""

private fun logSqliteVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ object ErrorReportControl {
const val SCREENSHOT_FILE = "screenshot.webp"

object BugReport {
fun createErrorText(exception: Throwable? = null) = try {
private fun createErrorText(exception: Throwable? = null) = try {
StringBuilder().run {
append("Version: ").append(applicationVersionName).append("\n")
append("Android version: ").append(Build.VERSION.RELEASE).append("\n")
Expand Down Expand Up @@ -170,8 +170,18 @@ object BugReport {

private val logDir get() = File(application.filesDir, "/log")

private fun logBasicInfo() {
Log.i(TAG, "logBasicInfo")
Log.i(TAG, "OS:" + System.getProperty("os.name") + " ver " + System.getProperty("os.version"))
Log.i(TAG, "Java:" + System.getProperty("java.vendor") + " ver " + System.getProperty("java.version"))
Log.i(TAG, "Java home:" + System.getProperty("java.home")!!)
Log.i(TAG, "User dir:" + System.getProperty("user.dir") + " Timezone:" + System.getProperty("user.timezone"))
Log.i(TAG, createErrorText())
}

fun saveLogcat() {
Log.i(TAG, "Trying to save logcat")
logBasicInfo()
val f = File(logDir, "logcat.txt.gz")
val log = StringBuilder()
try {
Expand Down

0 comments on commit 11eeb54

Please sign in to comment.