Skip to content

Commit

Permalink
Add WebView and Hardware details to Info clipboard copy (#8250)
Browse files Browse the repository at this point in the history
* Added additional debug info (WebView/Hardware)
Fixes #8234
  • Loading branch information
2tanayk authored Mar 24, 2021
1 parent 06d27b4 commit 175d961
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,13 @@ public String copyDebugInfo() {
Timber.w(e, "Unable to detect Rust Backend");
}


String webviewUserAgent = getWebviewUserAgent();
String debugInfo = "AnkiDroid Version = " + VersionUtils.getPkgVersionName() + "\n\n" +
"Android Version = " + Build.VERSION.RELEASE + "\n\n" +
"Manufacturer = " + Build.MANUFACTURER + "\n\n" +
"Model = " + Build.MODEL + "\n\n" +
"Hardware = " + Build.HARDWARE + "\n\n" +
"Webview User Agent = " + webviewUserAgent + "\n\n" +
"ACRA UUID = " + Installation.id(this) + "\n\n" +
"Scheduler = " + schedName + "\n\n" +
"Crash Reports Enabled = " + isSendingCrashReports() + "\n\n" +
Expand All @@ -236,6 +240,14 @@ public String copyDebugInfo() {
return debugInfo;
}

private String getWebviewUserAgent() {
try {
return new WebView(this).getSettings().getUserAgentString();
} catch (Throwable e) {
AnkiDroidApp.sendExceptionReport(e, "Info::copyDebugInfo()", "some issue occured while extracting webview user agent");
}
return null;
}

private boolean isSendingCrashReports() {
return AnkiDroidApp.isAcraEnbled(this, false);
Expand Down

0 comments on commit 175d961

Please sign in to comment.