Commit f22f1728 authored by Hazem Ashmawy's avatar Hazem Ashmawy Committed by Commit Bot

[AW] DevUI: Populate device/android build in the crash bug template

- Add build fingerprint instead of device and populate it.
- Add Android API level and populate it.
- Populate Application name, package name and version.
- Use WebView package name instead of package label name.
- Remove instructions on how to get app link on the playstore to shorten
  the template length following the limits on the URL query length.
- Add a new line to the template to guide the user to share additional
  comments on the crash.
- Use the "description" query name instead of "comment" in the
  constructed URL following monorail deep links documentation[1].

[1] https://chromium.googlesource.com/infra/infra/+/master/appengine/monorail/doc/userguide/power-users.md#deep-links

Fixed: 991594
Test: Press the report bug button and make sure the template is correctly populated
Test: Make sure that monorail directs to the template after log-in from the first time
Change-Id: Ie9296267915b12a5c940c625bd77bdab5647409a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2074880
Commit-Queue: Hazem Ashmawy <hazems@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Auto-Submit: Hazem Ashmawy <hazems@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745705}
parent 1d60f9e9
...@@ -10,11 +10,13 @@ import android.content.ClipData; ...@@ -10,11 +10,13 @@ import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.database.DataSetObserver; import android.database.DataSetObserver;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
...@@ -67,14 +69,12 @@ public class CrashesListActivity extends Activity { ...@@ -67,14 +69,12 @@ public class CrashesListActivity extends Activity {
+ "You only need to fill this out if you can share more information like steps to " + "You only need to fill this out if you can share more information like steps to "
+ "reproduce the crash.\n" + "reproduce the crash.\n"
+ "\n" + "\n"
+ "Device name:\n" + "Build fingerprint: %s\n"
+ "Android OS version:\n" + "Android API level: %s\n"
+ "WebView package: %s\n" + "WebView package: %s (%s/%s)\n"
+ "Application: (Please link to its Play Store page if possible. You can get the link " + "Application: %s\n"
+ "from inside the Play Store app by tapping the 3 dots in the upper right > Share > " + "Application version: %s\n"
+ "Copy to clipboard. Or you can find the app on the Play Store website: " + "If this app is available on Google Play, please include a URL:\n"
+ "https://play.google.com/store/apps.)\n"
+ "Application version:\n"
+ "\n" + "\n"
+ "\n" + "\n"
+ "Steps to reproduce:\n" + "Steps to reproduce:\n"
...@@ -87,6 +87,9 @@ public class CrashesListActivity extends Activity { ...@@ -87,6 +87,9 @@ public class CrashesListActivity extends Activity {
+ "(What should have happened?)\n" + "(What should have happened?)\n"
+ "\n" + "\n"
+ "\n" + "\n"
+ "<Any additional comments, you want to share>"
+ "\n"
+ "\n"
+ "****DO NOT CHANGE BELOW THIS LINE****\n" + "****DO NOT CHANGE BELOW THIS LINE****\n"
+ "Crash ID: http://crash/%s\n"; + "Crash ID: http://crash/%s\n";
...@@ -361,17 +364,33 @@ public class CrashesListActivity extends Activity { ...@@ -361,17 +364,33 @@ public class CrashesListActivity extends Activity {
// It uses WebView Bugs Template and adds "User-Submitted" Label. // It uses WebView Bugs Template and adds "User-Submitted" Label.
// It adds the upload id at the end of the template and populates the Application package // It adds the upload id at the end of the template and populates the Application package
// name field. // name field.
// TODO(https://crbug.com/991594) populate more fields in the template.
private Uri getReportUri(CrashInfo crashInfo) { private Uri getReportUri(CrashInfo crashInfo) {
String appPackage = "";
String appVersion = "";
if (crashInfo.packageName != null) {
try {
PackageManager pm = getPackageManager();
PackageInfo packageInfo = pm.getPackageInfo(crashInfo.packageName, 0);
appPackage = crashInfo.packageName;
appVersion = String.format(
Locale.US, "%s/%s", packageInfo.versionName, packageInfo.versionCode);
} catch (PackageManager.NameNotFoundException e) {
}
}
PackageInfo webViewPackage =
WebViewPackageHelper.getContextPackageInfo(CrashesListActivity.this);
return new Uri.Builder() return new Uri.Builder()
.scheme("https") .scheme("https")
.authority("bugs.chromium.org") .authority("bugs.chromium.org")
.path("/p/chromium/issues/entry") .path("/p/chromium/issues/entry")
.appendQueryParameter("template", "Webview+Bugs") .appendQueryParameter("template", "Webview+Bugs")
.appendQueryParameter("comment", .appendQueryParameter("description",
String.format(Locale.US, CRASH_REPORT_TEMPLATE, String.format(Locale.US, CRASH_REPORT_TEMPLATE, Build.FINGERPRINT,
WebViewPackageHelper.loadLabel(CrashesListActivity.this), Build.VERSION.SDK_INT, webViewPackage.packageName,
crashInfo.uploadId)) webViewPackage.versionName, webViewPackage.versionCode, appPackage,
appVersion, crashInfo.uploadId))
.appendQueryParameter("labels", "User-Submitted") .appendQueryParameter("labels", "User-Submitted")
.build(); .build();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment