From e00b3caeba24aff81ea0405136c0893b180a8ab2 Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 20 Sep 2014 12:04:50 +0200 Subject: [PATCH] ACRA analyzer enhanced --- .../org/solovyev/acraanalyzer/AcraAnalyzer.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/solovyev/acraanalyzer/AcraAnalyzer.java b/core/src/main/java/org/solovyev/acraanalyzer/AcraAnalyzer.java index 67bd1f7d..3661741c 100644 --- a/core/src/main/java/org/solovyev/acraanalyzer/AcraAnalyzer.java +++ b/core/src/main/java/org/solovyev/acraanalyzer/AcraAnalyzer.java @@ -71,7 +71,7 @@ public final class AcraAnalyzer { } PrintStream outIs; - if(!isEmpty(out)) { + if (!isEmpty(out)) { final File outFile = new File(out); outIs = new PrintStream(outFile); System.out.println("Output will be written to " + outFile.getPath()); @@ -102,7 +102,8 @@ public final class AcraAnalyzer { final AcraReport report = getFirstCollectionElement(sortedReport); outIs.println("Count: " + sortedReport.size()); outIs.println("App version: " + report.appVersion); - outIs.println("Android: " + getAndroidVersions(sortedReport)); + outIs.println("Android versions: " + getAndroidVersions(sortedReport)); + outIs.println("Phones: " + getPhones(sortedReport)); outIs.println("Stack trace: " + report.stackTrace); } } else { @@ -111,6 +112,15 @@ public final class AcraAnalyzer { } } + @Nonnull + private static String getPhones(@Nonnull Collection reports) { + final Set versions = new HashSet(); + for (AcraReport report : reports) { + versions.add(report.brand + "/" + report.phoneModel); + } + return versions.toString(); + } + @Nonnull private static String getAndroidVersions(@Nonnull Collection reports) { final Set versions = new HashSet();