Commit e2450614 authored by Youkichi Hosoi's avatar Youkichi Hosoi Committed by Commit Bot

Use command line argument --enable-ndk-translation64 for ARCVM setup

The availabilities of binary translation libraries for ARC++ are
determined by Chrome OS build-time USE flags houdini, houdini64,
ndk_translation, and ndk_translation64. The information of these flags
is used by Chrome to properly set up the binary translation related
properties for ARCVM.
Previously, the information on the ndk_translation64 USE flag was not
available for Chrome. However, by crrev.com/c/2219757 and
crrev.com/c/2222062, Chrome OS now puts --enable-ndk-translation64 in
Chrome's command line arguments iff the ndk_translation64 USE flag is
set at build time.
This CL makes Chrome properly handle this new information in the same
way as that of the other USE flags.

BUG=b:139480143
TEST=components_unittests
TEST=Write/delete ndk_translation64 to/from DUT's /etc/ui_use_flags.txt.
TEST=Restart UI and log in.
TEST=Run getprop and confirm that the edit is properly reflected upon
TEST=the property ro.boot.native_bridge.

Change-Id: I74e180edbb128bd1410f2951eaaa6a52328c4f9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222240Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Commit-Queue: Youkichi Hosoi <youkichihosoi@chromium.org>
Auto-Submit: Youkichi Hosoi <youkichihosoi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779201}
parent 422ef199
......@@ -264,15 +264,18 @@ const char kEnableEncryptionMigration[] = "enable-encryption-migration";
// Enables sharing assets for installed default apps.
const char kEnableExtensionAssetsSharing[] = "enable-extension-assets-sharing";
// Enables the use of Houdini library for ARM binary translation.
// Enables the use of 32-bit Houdini library for ARM binary translation.
const char kEnableHoudini[] = "enable-houdini";
// Enables the use of Houdini 64-bit library for ARM binary translation.
// Enables the use of 64-bit Houdini library for ARM binary translation.
const char kEnableHoudini64[] = "enable-houdini64";
// Enables the use of NDK translation library for ARM binary translation.
// Enables the use of 32-bit NDK translation library for ARM binary translation.
const char kEnableNdkTranslation[] = "enable-ndk-translation";
// Enables the use of 64-bit NDK translation library for ARM binary translation.
const char kEnableNdkTranslation64[] = "enable-ndk-translation64";
// Enables request of tablet site (via user agent override).
const char kEnableRequestTabletSite[] = "enable-request-tablet-site";
......
......@@ -115,6 +115,8 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableHoudini[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableHoudini64[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableNdkTranslation[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnableNdkTranslation64[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnableRequestTabletSite[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnableTouchCalibrationSetting[];
......
......@@ -114,11 +114,12 @@ std::string MonotonicTimestamp() {
ArcBinaryTranslationType IdentifyBinaryTranslationType(
const StartParams& start_params) {
const auto* command_line = base::CommandLine::ForCurrentProcess();
bool is_houdini_available =
const bool is_houdini_available =
command_line->HasSwitch(chromeos::switches::kEnableHoudini) ||
command_line->HasSwitch(chromeos::switches::kEnableHoudini64);
bool is_ndk_translation_available =
command_line->HasSwitch(chromeos::switches::kEnableNdkTranslation);
const bool is_ndk_translation_available =
command_line->HasSwitch(chromeos::switches::kEnableNdkTranslation) ||
command_line->HasSwitch(chromeos::switches::kEnableNdkTranslation64);
if (!is_houdini_available && !is_ndk_translation_available)
return ArcBinaryTranslationType::NONE;
......
......@@ -58,7 +58,7 @@ constexpr int64_t kCid = 123;
StartParams GetPopulatedStartParams() {
StartParams params;
params.native_bridge_experiment = true;
params.native_bridge_experiment = false;
params.lcd_density = 240;
params.arc_file_picker_experiment = true;
params.play_store_auto_update =
......@@ -1098,8 +1098,8 @@ TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNone) {
"androidboot.native_bridge=0"));
}
// Tests that the binary translation type is set to Houdini when only Houdini
// library is enabled by USE flags.
// Tests that the binary translation type is set to Houdini when only 32-bit
// Houdini library is enabled by USE flags.
TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeHoudini) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--enable-houdini"});
......@@ -1112,8 +1112,8 @@ TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeHoudini) {
"androidboot.native_bridge=libhoudini.so"));
}
// Tests that the binary translation type is set to Houdini when only Houdini
// 64-bit library is enabled by USE flags.
// Tests that the binary translation type is set to Houdini when only 64-bit
// Houdini library is enabled by USE flags.
TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeHoudini64) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--enable-houdini64"});
......@@ -1127,7 +1127,7 @@ TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeHoudini64) {
}
// Tests that the binary translation type is set to NDK translation when only
// NDK translation library is enabled by USE flags.
// 32-bit NDK translation library is enabled by USE flags.
TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNdkTranslation) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--enable-ndk-translation"});
......@@ -1140,13 +1140,28 @@ TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNdkTranslation) {
"androidboot.native_bridge=libndk_translation.so"));
}
// Tests that the binary translation type is set to NDK translation when only
// 64-bit NDK translation library is enabled by USE flags.
TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNdkTranslation64) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--enable-ndk-translation64"});
StartParams start_params(GetPopulatedStartParams());
SetValidUserInfo();
StartMiniArcWithParams(true, std::move(start_params));
UpgradeArc(true);
EXPECT_TRUE(
base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(),
"androidboot.native_bridge=libndk_translation.so"));
}
// Tests that the binary translation type is set to NDK translation when both
// Houdini and NDK translation libraries are enabled by USE flags, and the
// parameter start_params.native_bridge_experiment is set.
// parameter start_params.native_bridge_experiment is set to true.
TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNativeBridgeExperiment) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--enable-houdini", "--enable-ndk-translation"});
StartParams start_params(GetPopulatedStartParams());
start_params.native_bridge_experiment = true;
SetValidUserInfo();
StartMiniArcWithParams(true, std::move(start_params));
UpgradeArc(true);
......@@ -1157,7 +1172,7 @@ TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNativeBridgeExperiment) {
// Tests that the binary translation type is set to Houdini when both Houdini
// and NDK translation libraries are enabled by USE flags, and the parameter
// start_params.native_bridge_experiment is not set.
// start_params.native_bridge_experiment is set to false.
TEST_F(ArcVmClientAdapterTest, BintaryTranslationTypeNoNativeBridgeExperiment) {
base::CommandLine::ForCurrentProcess()->InitFromArgv(
{"", "--enable-houdini", "--enable-ndk-translation"});
......
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