mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Add App version info
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
eca49155c5
commit
61685e2ee9
2 changed files with 25 additions and 2 deletions
|
@ -21,7 +21,7 @@ package com.nextcloud.client.appinfo;
|
||||||
|
|
||||||
import com.owncloud.android.BuildConfig;
|
import com.owncloud.android.BuildConfig;
|
||||||
|
|
||||||
class AppInfoImpl implements AppInfo {
|
public class AppInfoImpl implements AppInfo {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFormattedVersionCode() {
|
public String getFormattedVersionCode() {
|
||||||
|
|
|
@ -25,6 +25,9 @@ import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import com.nextcloud.client.appinfo.AppInfoImpl
|
||||||
|
import com.owncloud.android.BuildConfig
|
||||||
|
import com.owncloud.android.R
|
||||||
import java.io.PrintWriter
|
import java.io.PrintWriter
|
||||||
import java.io.StringWriter
|
import java.io.StringWriter
|
||||||
import kotlin.system.exitProcess
|
import kotlin.system.exitProcess
|
||||||
|
@ -54,9 +57,29 @@ class ExceptionHandler(private val context: Activity) : Thread.UncaughtException
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generateErrorReport(stackTrace: String): String {
|
private fun generateErrorReport(stackTrace: String): String {
|
||||||
|
val appInfo = AppInfoImpl()
|
||||||
|
val buildNumber = context.resources.getString(R.string.buildNumber)
|
||||||
|
|
||||||
|
var buildNumberString = ""
|
||||||
|
if (buildNumber.isNotEmpty()) {
|
||||||
|
buildNumberString = " (build #$buildNumber)"
|
||||||
|
}
|
||||||
|
|
||||||
return "************ CAUSE OF ERROR ************\n\n" +
|
return "************ CAUSE OF ERROR ************\n\n" +
|
||||||
stackTrace +
|
stackTrace +
|
||||||
"\n************ DEVICE INFORMATION ***********" +
|
"\n************ APP INFORMATION ************" +
|
||||||
|
LINE_SEPARATOR +
|
||||||
|
"ID: " +
|
||||||
|
BuildConfig.APPLICATION_ID +
|
||||||
|
LINE_SEPARATOR +
|
||||||
|
"Version: " +
|
||||||
|
appInfo.formattedVersionCode +
|
||||||
|
buildNumberString +
|
||||||
|
LINE_SEPARATOR +
|
||||||
|
"Build flavor: " +
|
||||||
|
BuildConfig.FLAVOR +
|
||||||
|
LINE_SEPARATOR +
|
||||||
|
"\n************ DEVICE INFORMATION ************" +
|
||||||
LINE_SEPARATOR +
|
LINE_SEPARATOR +
|
||||||
"Brand: " +
|
"Brand: " +
|
||||||
Build.BRAND +
|
Build.BRAND +
|
||||||
|
|
Loading…
Reference in a new issue