Commit be35cd67 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Refactor BuildInfo to correct the "package" field of WebView minidumps

This adds the concept of "hostPackage" vs "package", which for webview
will contain different values.

TBR=agrieve  # trivial rename in devtools_http_handler.cc
Bug: 620323

Change-Id: I4a3c3376d3793eb3ddb90afe3359e320d6255edc
Reviewed-on: https://chromium-review.googlesource.com/939715
Commit-Queue: agrieve <agrieve@chromium.org>
Reviewed-by: default avatarMaria Khomenko <mariakhomenko@chromium.org>
Reviewed-by: default avatarTobias Sargeant <tobiasjs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541114}
parent fe6b786e
......@@ -53,7 +53,7 @@ int AwNetworkDelegate::OnBeforeStartTransaction(
DCHECK(headers);
headers->SetHeaderIfMissing(
"X-Requested-With",
base::android::BuildInfo::GetInstance()->package_name());
base::android::BuildInfo::GetInstance()->host_package_name());
return net::OK;
}
......
......@@ -36,6 +36,7 @@ import org.chromium.android_webview.AwBrowserProcess;
import org.chromium.android_webview.ResourcesContextWrapperFactory;
import org.chromium.android_webview.WebViewChromiumRunQueue;
import org.chromium.android_webview.command_line.CommandLineUtil;
import org.chromium.base.BuildInfo;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.PackageUtils;
......@@ -202,11 +203,12 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
}
ThreadUtils.setWillOverrideUiThread();
final PackageInfo packageInfo = WebViewFactory.getLoadedPackageInfo();
BuildInfo.setBrowserPackageInfo(packageInfo);
// Load chromium library.
AwBrowserProcess.loadLibrary(mWebViewDelegate.getDataDirectorySuffix());
final PackageInfo packageInfo = WebViewFactory.getLoadedPackageInfo();
StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
try {
// Load glue-layer support library.
......
......@@ -241,11 +241,11 @@ void AwMainDelegate::PreSandboxStartup() {
static ::crash_reporter::CrashKeyString<64> app_name_key(
crash_keys::kAppPackageName);
app_name_key.Set(android_build_info->package_name());
app_name_key.Set(android_build_info->host_package_name());
static ::crash_reporter::CrashKeyString<64> app_version_key(
crash_keys::kAppPackageVersionCode);
app_version_key.Set(android_build_info->package_version_code());
app_version_key.Set(android_build_info->host_version_code());
static ::crash_reporter::CrashKeyString<8> sdk_int_key(
crash_keys::kAndroidSdkInt);
......
......@@ -61,16 +61,18 @@ BuildInfo::BuildInfo(const std::vector<std::string>& params)
model_(StrDupParam(params, 4)),
sdk_int_(SdkIntParam(params, 5)),
build_type_(StrDupParam(params, 6)),
package_label_(StrDupParam(params, 7)),
package_name_(StrDupParam(params, 8)),
package_version_code_(StrDupParam(params, 9)),
package_version_name_(StrDupParam(params, 10)),
android_build_fp_(StrDupParam(params, 11)),
gms_version_code_(StrDupParam(params, 12)),
installer_package_name_(StrDupParam(params, 13)),
abi_name_(StrDupParam(params, 14)),
firebase_app_id_(StrDupParam(params, 15)),
extracted_file_suffix_(params[16]),
host_package_name_(StrDupParam(params, 7)),
host_version_code_(StrDupParam(params, 8)),
host_package_label_(StrDupParam(params, 9)),
package_name_(StrDupParam(params, 10)),
package_version_code_(StrDupParam(params, 11)),
package_version_name_(StrDupParam(params, 12)),
android_build_fp_(StrDupParam(params, 13)),
gms_version_code_(StrDupParam(params, 14)),
installer_package_name_(StrDupParam(params, 15)),
abi_name_(StrDupParam(params, 16)),
firebase_app_id_(StrDupParam(params, 17)),
extracted_file_suffix_(params[18]),
java_exception_info_(NULL) {}
// static
......
......@@ -82,6 +82,12 @@ class BASE_EXPORT BuildInfo {
return gms_version_code_;
}
const char* host_package_name() const { return host_package_name_; }
const char* host_version_code() const { return host_version_code_; }
const char* host_package_label() const { return host_package_label_; }
const char* package_version_code() const {
return package_version_code_;
}
......@@ -90,10 +96,6 @@ class BASE_EXPORT BuildInfo {
return package_version_name_;
}
const char* package_label() const {
return package_label_;
}
const char* package_name() const {
return package_name_;
}
......@@ -139,7 +141,9 @@ class BASE_EXPORT BuildInfo {
const char* const model_;
const int sdk_int_;
const char* const build_type_;
const char* const package_label_;
const char* const host_package_name_;
const char* const host_version_code_;
const char* const host_package_label_;
const char* const package_name_;
const char* const package_version_code_;
const char* const package_version_name_;
......
......@@ -4,6 +4,7 @@
package org.chromium.base;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
......@@ -18,109 +19,113 @@ import org.chromium.base.annotations.CalledByNative;
* primarily of use for accessing package information from native code.
*/
public class BuildInfo {
/**
* Array index to access field in {@link BuildInfo#getAll()}.
*/
public static final int BRAND_INDEX = 0;
public static final int DEVICE_INDEX = 1;
public static final int ANDROID_BUILD_ID_INDEX = 2;
public static final int MODEL_INDEX = 4;
public static final int ANDROID_BUILD_FP_INDEX = 11;
public static final int GMS_CORE_VERSION_INDEX = 12;
public static final int INSTALLER_PACKAGE_NAME_INDEX = 13;
public static final int ABI_NAME_INDEX = 14;
private static final String TAG = "BuildInfo";
private static final int MAX_FINGERPRINT_LENGTH = 128;
private static PackageInfo sBrowserPackageInfo;
private static boolean sInitialized;
/** The application name (e.g. "Chrome"). For WebView, this is name of the embedding app. */
public final String hostPackageLabel;
/** By default: same as versionCode. For WebView: versionCode of the embedding app. */
public final int hostVersionCode;
/** The packageName of Chrome/WebView. Use application context for host app packageName. */
public final String packageName;
/** The versionCode of the apk. */
public final int versionCode;
/** The versionName of Chrome/WebView. Use application context for host app versionName. */
public final String versionName;
/** Result of PackageManager.getInstallerPackageName(). Never null, but may be "". */
public final String installerPackageName;
/** The versionCode of Play Services (for crash reporting). */
public final String gmsVersionCode;
/** Formatted ABI string (for crash reporting). */
public final String abiString;
/** Truncated version of Build.FINGERPRINT (for crash reporting). */
public final String androidBuildFingerprint;
/** A string that is different each time the apk changes. */
public final String extractedFileSuffix;
private static class Holder { private static BuildInfo sInstance = new BuildInfo(); }
@CalledByNative
private static String[] getAll() {
BuildInfo buildInfo = getInstance();
String hostPackageName = ContextUtils.getApplicationContext().getPackageName();
return new String[] {
Build.BRAND, Build.DEVICE, Build.ID, Build.MANUFACTURER, Build.MODEL,
String.valueOf(Build.VERSION.SDK_INT), Build.TYPE, hostPackageName,
String.valueOf(buildInfo.hostVersionCode), buildInfo.hostPackageLabel,
buildInfo.packageName, String.valueOf(buildInfo.versionCode), buildInfo.versionName,
buildInfo.androidBuildFingerprint, buildInfo.gmsVersionCode,
buildInfo.installerPackageName, buildInfo.abiString, BuildConfig.FIREBASE_APP_ID,
buildInfo.extractedFileSuffix,
};
}
/**
* BuildInfo is a static utility class and therefore shouldn't be instantiated.
* @param packageInfo Package for Chrome/WebView (as opposed to host app).
*/
private BuildInfo() {}
public static void setBrowserPackageInfo(PackageInfo packageInfo) {
assert !sInitialized;
sBrowserPackageInfo = packageInfo;
}
@SuppressWarnings("deprecation")
@CalledByNative
public static String[] getAll() {
public static BuildInfo getInstance() {
return Holder.sInstance;
}
private BuildInfo() {
sInitialized = true;
try {
String packageName = ContextUtils.getApplicationContext().getPackageName();
PackageManager pm = ContextUtils.getApplicationContext().getPackageManager();
PackageInfo pi = pm.getPackageInfo(packageName, 0);
String versionCode = pi.versionCode <= 0 ? "" : Integer.toString(pi.versionCode);
String versionName = pi.versionName == null ? "" : pi.versionName;
Context appContext = ContextUtils.getApplicationContext();
String hostPackageName = appContext.getPackageName();
PackageManager pm = appContext.getPackageManager();
PackageInfo pi = pm.getPackageInfo(hostPackageName, 0);
hostVersionCode = pi.versionCode;
if (sBrowserPackageInfo != null) {
packageName = sBrowserPackageInfo.packageName;
versionCode = sBrowserPackageInfo.versionCode;
versionName = sBrowserPackageInfo.versionName;
sBrowserPackageInfo = null;
} else {
packageName = hostPackageName;
versionCode = hostVersionCode;
versionName = pi.versionName;
}
CharSequence label = pm.getApplicationLabel(pi.applicationInfo);
String packageLabel = label == null ? "" : label.toString();
hostPackageLabel = label == null ? "" : label.toString();
String installerPackageName = pm.getInstallerPackageName(packageName);
if (installerPackageName == null) {
installerPackageName = "";
String value = pm.getInstallerPackageName(packageName);
installerPackageName = value == null ? "" : value;
PackageInfo gmsPackageInfo = null;
try {
gmsPackageInfo = pm.getPackageInfo("com.google.android.gms", 0);
} catch (NameNotFoundException e) {
Log.d(TAG, "GMS package is not found.", e);
}
gmsVersionCode = gmsPackageInfo != null ? String.valueOf(gmsPackageInfo.versionCode)
: "gms versionCode not available.";
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;
abiString = String.format("ABI1: %s, ABI2: %s", Build.CPU_ABI, 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;
String extractedFileSuffix = String.format("@%s", Long.toHexString(version));
// Do not alter this list without updating callers of it.
return new String[] {
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),
installerPackageName, abiString, BuildConfig.FIREBASE_APP_ID,
extractedFileSuffix,
};
} catch (NameNotFoundException e) {
throw new RuntimeException(e);
}
}
/**
* @return The build fingerprint for the current Android install. The value is truncated to a
* 128 characters as this is used for crash and UMA reporting, which should avoid huge
* strings.
*/
private static String getAndroidBuildFingerprint() {
return Build.FINGERPRINT.substring(
0, Math.min(Build.FINGERPRINT.length(), MAX_FINGERPRINT_LENGTH));
}
long version = versionCode > 10 ? versionCode : pi.lastUpdateTime;
extractedFileSuffix = String.format("@%x", version);
private static String getGMSVersionCode(PackageManager packageManager) {
String msg = "gms versionCode not available.";
try {
PackageInfo packageInfo = packageManager.getPackageInfo("com.google.android.gms", 0);
msg = Integer.toString(packageInfo.versionCode);
// The value is truncated, as this is used for crash and UMA reporting.
androidBuildFingerprint = Build.FINGERPRINT.substring(
0, Math.min(Build.FINGERPRINT.length(), MAX_FINGERPRINT_LENGTH));
} catch (NameNotFoundException e) {
Log.d(TAG, "GMS package is not found.", e);
throw new RuntimeException(e);
}
return msg;
}
public static String getPackageVersionCode() {
return getAll()[9];
}
public static String getPackageVersionName() {
return getAll()[10];
}
/** Returns a string that is different each time the apk changes. */
public static String getExtractedFileSuffix() {
return getAll()[16];
}
public static String getPackageLabel() {
return getAll()[7];
}
public static String getPackageName() {
return ContextUtils.getApplicationContext().getPackageName();
}
/**
......
......@@ -64,7 +64,7 @@ public class ResourceExtractor {
// Use a suffix for extracted files in order to guarantee that the version of the file
// on disk matches up with the version of the APK.
String extractSuffix = BuildInfo.getExtractedFileSuffix();
String extractSuffix = BuildInfo.getInstance().extractedFileSuffix;
String[] existingFileNames = outputDir.list();
boolean allFilesExist = existingFileNames != null;
if (allFilesExist) {
......
......@@ -92,8 +92,8 @@ public final class DefaultBrowserInfo {
Context context = ContextUtils.getApplicationContext();
ArrayList<String> menuTitles = new ArrayList<String>(2);
// Store the package label of current application.
menuTitles.add(
getTitleFromPackageLabel(context, BuildInfo.getPackageLabel()));
menuTitles.add(getTitleFromPackageLabel(
context, BuildInfo.getInstance().hostPackageLabel));
PackageManager pm = context.getPackageManager();
ResolveInfo info = getResolveInfoForViewIntent(pm);
......
......@@ -95,7 +95,7 @@ public class BookmarkUtils {
createSnackbarControllerForEditButton(activity, bookmarkId);
if (getLastUsedParent(activity) == null) {
if (fromCustomTab) {
String packageLabel = BuildInfo.getPackageLabel();
String packageLabel = BuildInfo.getInstance().hostPackageLabel;
snackbar = Snackbar.make(
activity.getString(R.string.bookmark_page_saved, packageLabel),
snackbarController, Snackbar.TYPE_ACTION, Snackbar.UMA_BOOKMARK_ADDED);
......
......@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.crash;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningAppProcessInfo;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import org.chromium.base.ApiCompatibilityUtils;
......@@ -116,24 +117,24 @@ public class PureJavaExceptionReporter {
processName = "browser";
}
String[] allInfo = BuildInfo.getAll();
BuildInfo buildInfo = BuildInfo.getInstance();
addPairedString(PRODUCT, "Chrome_Android");
addPairedString(PROCESS_TYPE, processName);
addPairedString(DEVICE, allInfo[BuildInfo.DEVICE_INDEX]);
addPairedString(DEVICE, Build.DEVICE);
addPairedString(VERSION, ChromeVersionInfo.getProductVersion());
addPairedString(CHANNEL, getChannel());
addPairedString(ANDROID_BUILD_ID, allInfo[BuildInfo.ANDROID_BUILD_ID_INDEX]);
addPairedString(MODEL, allInfo[BuildInfo.MODEL_INDEX]);
addPairedString(BRAND, allInfo[BuildInfo.BRAND_INDEX]);
addPairedString(ANDROID_BUILD_FP, allInfo[BuildInfo.ANDROID_BUILD_FP_INDEX]);
addPairedString(GMS_CORE_VERSION, allInfo[BuildInfo.GMS_CORE_VERSION_INDEX]);
addPairedString(INSTALLER_PACKAGE_NAME, allInfo[BuildInfo.INSTALLER_PACKAGE_NAME_INDEX]);
addPairedString(ABI_NAME, allInfo[BuildInfo.ABI_NAME_INDEX]);
addPairedString(ANDROID_BUILD_ID, Build.ID);
addPairedString(MODEL, Build.MODEL);
addPairedString(BRAND, Build.BRAND);
addPairedString(ANDROID_BUILD_FP, buildInfo.androidBuildFingerprint);
addPairedString(GMS_CORE_VERSION, buildInfo.gmsVersionCode);
addPairedString(INSTALLER_PACKAGE_NAME, buildInfo.installerPackageName);
addPairedString(ABI_NAME, buildInfo.abiString);
addPairedString(EXCEPTION_INFO, Log.getStackTraceString(javaException));
addPairedString(EARLY_JAVA_EXCEPTION, "true");
addPairedString(PACKAGE,
BuildConfig.FIREBASE_APP_ID + " v" + BuildInfo.getPackageVersionCode() + " ("
+ BuildInfo.getPackageVersionName() + ")");
String.format("%s v%s (%s)", BuildConfig.FIREBASE_APP_ID, buildInfo.versionCode,
buildInfo.versionName));
addString(mBoundary);
}
......
......@@ -94,7 +94,7 @@ public class DownloadSnackbarController implements SnackbarManager.SnackbarContr
if (getSnackbarManager() == null) return;
Snackbar snackbar;
if (getActivity() instanceof CustomTabActivity) {
String packageLabel = BuildInfo.getPackageLabel();
String packageLabel = BuildInfo.getInstance().hostPackageLabel;
snackbar = Snackbar.make(mContext.getString(R.string.download_succeeded_message,
downloadInfo.getFileName(), packageLabel),
this, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_DOWNLOAD_SUCCEEDED);
......
......@@ -180,7 +180,8 @@ public abstract class RequestGenerator {
* these strings when building their own custom Android ROMs.
*/
public String getAdditionalParameters() {
String applicationLabel = StringSanitizer.sanitize(BuildInfo.getPackageLabel());
String applicationLabel =
StringSanitizer.sanitize(BuildInfo.getInstance().hostPackageLabel);
String brand = StringSanitizer.sanitize(Build.BRAND);
String model = StringSanitizer.sanitize(Build.MODEL);
return applicationLabel + ";" + brand + ";" + model;
......
......@@ -60,7 +60,7 @@ public class VersionNumberGetter {
* @return The latest version if we retrieved one from the Omaha server, or "" if we haven't.
*/
public String getCurrentlyUsedVersion(Context context) {
return BuildInfo.getPackageVersionName();
return BuildInfo.getInstance().versionName;
}
/**
......
......@@ -12,7 +12,7 @@ import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.provider.Settings;
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
......@@ -103,7 +103,8 @@ public class MainPreferences extends PreferenceFragment
notifications.setOnPreferenceClickListener(preference -> {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, BuildInfo.getPackageName());
intent.putExtra(Settings.EXTRA_APP_PACKAGE,
ContextUtils.getApplicationContext().getPackageName());
startActivity(intent);
// We handle the click so the default action (opening NotificationsPreference)
// isn't triggered.
......
......@@ -101,7 +101,8 @@ public class SyncPreference extends Preference {
if (profileSyncService.getProtocolErrorClientAction()
== ProtocolErrorClientAction.UPGRADE_CLIENT) {
return res.getString(R.string.sync_error_upgrade_client, BuildInfo.getPackageLabel());
return res.getString(
R.string.sync_error_upgrade_client, BuildInfo.getInstance().hostPackageLabel);
}
if (profileSyncService.hasUnrecoverableError()) {
......
......@@ -30,7 +30,7 @@ import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
......@@ -202,7 +202,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL
recordPassphraseDialogDismissal(PASSPHRASE_DIALOG_RESET_LINK);
Uri syncDashboardUrl = Uri.parse(ChromeStringConstants.SYNC_DASHBOARD_URL);
Intent intent = new Intent(Intent.ACTION_VIEW, syncDashboardUrl);
intent.setPackage(BuildInfo.getPackageName());
intent.setPackage(ContextUtils.getApplicationContext().getPackageName());
IntentUtils.safePutBinderExtra(
intent, CustomTabsIntent.EXTRA_SESSION, null);
context.startActivity(intent);
......
......@@ -26,7 +26,7 @@ import android.widget.CheckedTextView;
import android.widget.ListView;
import android.widget.TextView;
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeStringConstants;
......@@ -195,7 +195,7 @@ public class PassphraseTypeDialogFragment extends DialogFragment implements
public void onClick(View view) {
Uri syncDashboardUrl = Uri.parse(ChromeStringConstants.SYNC_DASHBOARD_URL);
Intent intent = new Intent(Intent.ACTION_VIEW, syncDashboardUrl);
intent.setPackage(BuildInfo.getPackageName());
intent.setPackage(ContextUtils.getApplicationContext().getPackageName());
IntentUtils.safePutBinderExtra(
intent, CustomTabsIntent.EXTRA_SESSION, null);
context.startActivity(intent);
......
......@@ -31,6 +31,7 @@ import android.view.ViewGroup;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
......@@ -679,7 +680,8 @@ public class SyncCustomizationFragment extends PreferenceFragment
case SYNC_AUTH_ERROR:
return res.getString(R.string.hint_sync_auth_error);
case SYNC_CLIENT_OUT_OF_DATE:
return res.getString(R.string.hint_client_out_of_date, BuildInfo.getPackageLabel());
return res.getString(
R.string.hint_client_out_of_date, BuildInfo.getInstance().hostPackageLabel);
case SYNC_OTHER_ERRORS:
return res.getString(R.string.hint_other_sync_errors);
case SYNC_PASSPHRASE_REQUIRED:
......@@ -716,7 +718,8 @@ public class SyncCustomizationFragment extends PreferenceFragment
if (mCurrentSyncError == SYNC_CLIENT_OUT_OF_DATE) {
// Opens the client in play store for update.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=" + BuildInfo.getPackageName()));
intent.setData(Uri.parse("market://details?id="
+ ContextUtils.getApplicationContext().getPackageName()));
startActivity(intent);
return;
}
......
......@@ -13,7 +13,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisableIf;
import org.chromium.base.test.util.Feature;
......@@ -53,7 +53,7 @@ public class ProcessIsolationTest {
// in the RunningAppProcessInfo for isolated processes is the same as the parent process
// (see b/7724486, closed as "Working as intended").
// So we have to resort to parsing the ps output.
String packageName = BuildInfo.getPackageName();
String packageName = ContextUtils.getApplicationContext().getPackageName();
Assert.assertFalse("Failed to retrieve package name for current version of Chrome.",
TextUtils.isEmpty(packageName));
......
......@@ -989,7 +989,7 @@ static ScopedJavaLocalRef<jobject> JNI_PrefServiceBridge_GetAboutVersionStrings(
base::android::BuildInfo* android_build_info =
base::android::BuildInfo::GetInstance();
std::string application(android_build_info->package_label());
std::string application(android_build_info->host_package_label());
application.append(" ");
application.append(version_info::GetVersionNumber());
......
......@@ -551,8 +551,9 @@ void DevToolsHttpHandler::OnJsonRequest(
kTargetWebSocketDebuggerUrlField,
base::StringPrintf("ws://%s%s", host.c_str(), browser_guid_.c_str()));
#if defined(OS_ANDROID)
version.SetString("Android-Package",
base::android::BuildInfo::GetInstance()->package_name());
version.SetString(
"Android-Package",
base::android::BuildInfo::GetInstance()->host_package_name());
#endif
SendJson(connection_id, net::HTTP_OK, &version, std::string());
return;
......
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