aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/utils/ExceptionHelper.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/ExceptionHelper.java b/src/main/java/de/pixart/messenger/utils/ExceptionHelper.java
index 8d59c83bf..834f83cea 100644
--- a/src/main/java/de/pixart/messenger/utils/ExceptionHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/ExceptionHelper.java
@@ -62,8 +62,10 @@ public class ExceptionHelper {
PackageInfo packageInfo;
String release = Build.VERSION.RELEASE;
int sdkVersion = Build.VERSION.SDK_INT;
+ String deviceName = getDeviceName();
try {
packageInfo = pm.getPackageInfo(activity.getPackageName(), PackageManager.GET_SIGNATURES);
+ report.append("Device: ").append(deviceName).append('\n');
report.append("Android SDK: ").append(sdkVersion).append(" (").append(release).append(")").append('\n');
report.append("Version: ").append(packageInfo.versionName).append('\n');
report.append("Last Update: ").append(DATE_FORMAT.format(new Date(packageInfo.lastUpdateTime))).append('\n');
@@ -100,6 +102,16 @@ public class ExceptionHelper {
}
}
+ public static String getDeviceName() {
+ String manufacturer = Build.MANUFACTURER;
+ String model = Build.MODEL;
+ if (model.startsWith(manufacturer)) {
+ return model;
+ } else {
+ return manufacturer + " " + model;
+ }
+ }
+
static void writeToStacktraceFile(Context context, String msg) {
try {
OutputStream os = context.openFileOutput(FILENAME, Context.MODE_PRIVATE);