ACRA analyzer enhanced

This commit is contained in:
serso 2014-09-20 12:04:50 +02:00
parent ad915be120
commit e00b3caeba

View File

@ -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<AcraReport> reports) {
final Set<String> versions = new HashSet<String>();
for (AcraReport report : reports) {
versions.add(report.brand + "/" + report.phoneModel);
}
return versions.toString();
}
@Nonnull
private static String getAndroidVersions(@Nonnull Collection<AcraReport> reports) {
final Set<String> versions = new HashSet<String>();