Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1409)

Unified Diff: base/android/java/src/org/chromium/base/BuildInfo.java

Issue 2960883002: Add installer_package_name and ABI to crash report (Closed)
Patch Set: fix style Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/build_info.cc ('k') | components/crash/content/app/breakpad_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/BuildInfo.java
diff --git a/base/android/java/src/org/chromium/base/BuildInfo.java b/base/android/java/src/org/chromium/base/BuildInfo.java
index 4f1355f077f43fa52f6429dad1dcd0ca8b4ada0e..9617afb05ed259c90f078587a1b77467b59c2dd7 100644
--- a/base/android/java/src/org/chromium/base/BuildInfo.java
+++ b/base/android/java/src/org/chromium/base/BuildInfo.java
@@ -9,6 +9,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
+import android.text.TextUtils;
import org.chromium.base.annotations.CalledByNative;
@@ -25,6 +26,7 @@ public class BuildInfo {
*/
private BuildInfo() {}
+ @SuppressWarnings("deprecation")
@CalledByNative
private static String[] getAll() {
try {
@@ -37,6 +39,18 @@ public class BuildInfo {
CharSequence label = pm.getApplicationLabel(pi.applicationInfo);
String packageLabel = label == null ? "" : label.toString();
+ String installerPackageName = pm.getInstallerPackageName(packageName);
+ if (installerPackageName == null) {
+ installerPackageName = "";
+ }
+
+ String abiString = null;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ abiString = TextUtils.join(", ", Build.SUPPORTED_ABIS);
+ } else {
+ abiString = "ABI1: " + Build.CPU_ABI + ", ABI2: " + Build.CPU_ABI2;
+ }
+
// Use lastUpdateTime when developing locally, since versionCode does not normally
// change in this case.
long version = pi.versionCode > 10 ? pi.versionCode : pi.lastUpdateTime;
@@ -47,7 +61,7 @@ public class BuildInfo {
Build.BRAND, Build.DEVICE, Build.ID, Build.MANUFACTURER, Build.MODEL,
String.valueOf(Build.VERSION.SDK_INT), Build.TYPE, packageLabel, packageName,
versionCode, versionName, getAndroidBuildFingerprint(), getGMSVersionCode(pm),
- extractedFileSuffix,
+ installerPackageName, abiString, extractedFileSuffix,
};
} catch (NameNotFoundException e) {
throw new RuntimeException(e);
@@ -81,7 +95,7 @@ public class BuildInfo {
/** Returns a string that is different each time the apk changes. */
public static String getExtractedFileSuffix() {
- return getAll()[13];
+ return getAll()[15];
}
public static String getPackageLabel() {
« no previous file with comments | « base/android/build_info.cc ('k') | components/crash/content/app/breakpad_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698