Commit 54da7ccf authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

[android] Add extra ICU feature module

The module contains an ICU data file, added in crrev/c/1648623, for 30
extra languages we would like to support in Chrome going forward. The
DFM is installed on first Chrome install or update. That way all users
will receive the extra data file but we don't bloat the Android system
image. In a follow up CL, we will load the extra ICU data file on
startup if the module is installed.

Change-Id: I8368454977431031325f551616f7a19b51235ea0
Bug: 1006794
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811973
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698977}
parent 35cff248
...@@ -509,6 +509,7 @@ java_group("chrome_all_java") { ...@@ -509,6 +509,7 @@ java_group("chrome_all_java") {
"//chrome/android/features/keyboard_accessory:internal_java", "//chrome/android/features/keyboard_accessory:internal_java",
"//chrome/android/features/media_router:java", "//chrome/android/features/media_router:java",
"//chrome/android/features/test_dummy/internal:base_module_java", "//chrome/android/features/test_dummy/internal:base_module_java",
"//chrome/android/modules/extra_icu/provider:java",
"//chrome/browser/touch_to_fill/android/internal:java", "//chrome/browser/touch_to_fill/android/internal:java",
] ]
......
...@@ -4020,6 +4020,13 @@ The site does NOT gain access to the camera. The camera images are only visible ...@@ -4020,6 +4020,13 @@ The site does NOT gain access to the camera. The camera images are only visible
Test Dummy Test Dummy
</message> </message>
<message name="IDS_EXTRA_ICU_MODULE_TITLE"
desc="Text shown when the extra ICU module is referenced in install start, success,
failure UI (e.g. in IDS_MODULE_INSTALL_START_TEXT, which will expand to
'Installing Extra ICU for Chrome…').">
Extra ICU
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
...@@ -8,6 +8,7 @@ import( ...@@ -8,6 +8,7 @@ import(
import("//chrome/android/features/dev_ui/dev_ui_module.gni") import("//chrome/android/features/dev_ui/dev_ui_module.gni")
import("//chrome/android/features/tab_ui/tab_ui_module.gni") import("//chrome/android/features/tab_ui/tab_ui_module.gni")
import("//chrome/android/modules/buildflags.gni") import("//chrome/android/modules/buildflags.gni")
import("//chrome/android/modules/extra_icu/extra_icu_module.gni")
import("//chrome/android/modules/test_dummy/test_dummy_module.gni") import("//chrome/android/modules/test_dummy/test_dummy_module.gni")
import("//device/vr/buildflags/buildflags.gni") import("//device/vr/buildflags/buildflags.gni")
...@@ -35,7 +36,10 @@ if (enable_arcore) { ...@@ -35,7 +36,10 @@ if (enable_arcore) {
# Each new module needs to add a desc to one of the lists below. # Each new module needs to add a desc to one of the lists below.
# Modules shipped in Chrome Modern (Android L+). # Modules shipped in Chrome Modern (Android L+).
chrome_modern_module_descs = [ test_dummy_module_desc ] chrome_modern_module_descs = [
test_dummy_module_desc,
extra_icu_module_desc,
]
if (enable_vr) { if (enable_vr) {
chrome_modern_module_descs += [ vr_module_desc ] chrome_modern_module_descs += [ vr_module_desc ]
} }
......
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
extra_icu_module_desc = {
name = "extra_icu"
android_manifest =
"//chrome/android/modules/extra_icu/internal/java/AndroidManifest.xml"
java_deps = [
"//chrome/android/modules/extra_icu/internal:icudtl_extra_assets",
"//chrome/android/modules/extra_icu/internal:java",
]
}
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
android_library("java") {
java_files =
[ "java/src/org/chromium/chrome/modules/extra_icu/ExtraIcuImpl.java" ]
deps = [
"//base:base_java",
"//chrome/android/modules/extra_icu/public:java",
]
}
android_assets("icudtl_extra_assets") {
sources = [
"//third_party/icu/android_small/icudtl_extra.dat",
]
disable_compression = true
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
featureSplit="extra_icu">
<!-- Always install extra ICU module on first Chrome install or update. -->
<dist:module
dist:onDemand="false"
dist:title="@string/extra_icu_module_title">
<dist:fusing dist:include="false" />
</dist:module>
<application />
</manifest>
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.modules.extra_icu;
import org.chromium.base.annotations.UsedByReflection;
/** Interface implementation inside the module. */
@UsedByReflection("ExtraIcuModule")
public class ExtraIcuImpl implements ExtraIcu {}
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
android_library("java") {
deps = [
"//base:base_java",
"//chrome/android/modules/extra_icu/public:java",
]
java_files = [ "java/src/org/chromium/chrome/modules/extra_icu/ExtraIcuModuleProvider.java" ]
}
generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chrome/modules/extra_icu/ExtraIcuModuleProvider.java",
]
}
source_set("native") {
deps = [
":jni_headers",
]
sources = [
"module_provider.cc",
"module_provider.h",
]
}
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.modules.extra_icu;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
/** Java side of the extra ICU module installer. */
@JNINamespace("extra_icu")
public class ExtraIcuModuleProvider {
/** Returns true if the extra ICU module is installed. */
@CalledByNative
private static boolean isModuleInstalled() {
return ExtraIcuModule.isInstalled();
}
private ExtraIcuModuleProvider() {}
}
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/android/modules/extra_icu/provider/module_provider.h"
#include "chrome/android/modules/extra_icu/provider/jni_headers/ExtraIcuModuleProvider_jni.h"
namespace extra_icu {
// static
bool ModuleProvider::IsModuleInstalled() {
return Java_ExtraIcuModuleProvider_isModuleInstalled(
base::android::AttachCurrentThread());
}
} // namespace extra_icu
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_ANDROID_MODULES_EXTRA_ICU_PROVIDER_MODULE_PROVIDER_H_
#define CHROME_ANDROID_MODULES_EXTRA_ICU_PROVIDER_MODULE_PROVIDER_H_
namespace extra_icu {
// Native side of the extra ICU module installer.
class ModuleProvider {
public:
// Returns true if the extra ICU module is installed.
static bool IsModuleInstalled();
};
} // namespace extra_icu
#endif // CHROME_ANDROID_MODULES_EXTRA_ICU_PROVIDER_MODULE_PROVIDER_H_
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
android_library("java") {
java_files =
[ "java/src/org/chromium/chrome/modules/extra_icu/ExtraIcu.java" ]
deps = [
"//components/module_installer/android:module_installer_java",
"//components/module_installer/android:module_interface_java",
]
annotation_processor_deps =
[ "//components/module_installer/android:module_interface_processor" ]
}
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.modules.extra_icu;
import org.chromium.components.module_installer.ModuleInterface;
/** Interface into the extra ICU module. Only used to check whether module is installed. */
@ModuleInterface(module = "extra_icu", impl = "org.chromium.chrome.modules.extra_icu.ExtraIcuImpl")
public interface ExtraIcu {}
...@@ -2891,6 +2891,7 @@ jumbo_split_static_library("browser") { ...@@ -2891,6 +2891,7 @@ jumbo_split_static_library("browser") {
":explore_sites_proto", ":explore_sites_proto",
":usage_stats_proto", ":usage_stats_proto",
"//chrome/android:jni_headers", "//chrome/android:jni_headers",
"//chrome/android/modules/extra_icu/provider:native",
"//chrome/browser/android/thin_webview/internal", "//chrome/browser/android/thin_webview/internal",
"//chrome/browser/android/webapk:proto", "//chrome/browser/android/webapk:proto",
"//chrome/services/media_gallery_util/public/cpp", "//chrome/services/media_gallery_util/public/cpp",
......
...@@ -4,6 +4,7 @@ include_rules = [ ...@@ -4,6 +4,7 @@ include_rules = [
"+chrome/android/chrome_jni_headers", "+chrome/android/chrome_jni_headers",
"+chrome/android/features/autofill_assistant/jni_headers", "+chrome/android/features/autofill_assistant/jni_headers",
"+chrome/android/features/dev_ui", "+chrome/android/features/dev_ui",
"+chrome/android/modules",
"+chrome/android/public/profiles/jni_headers", "+chrome/android/public/profiles/jni_headers",
"+chrome/app", "+chrome/app",
"+chrome/chrome_watcher", "+chrome/chrome_watcher",
......
...@@ -162642,6 +162642,7 @@ regressions. --> ...@@ -162642,6 +162642,7 @@ regressions. -->
<suffix name="ar" label="Augmented Reality Module"/> <suffix name="ar" label="Augmented Reality Module"/>
<suffix name="autofill_assistant" label="Assistant-in-Chrome Module"/> <suffix name="autofill_assistant" label="Assistant-in-Chrome Module"/>
<suffix name="dev_ui" label="Developer UI Module"/> <suffix name="dev_ui" label="Developer UI Module"/>
<suffix name="extra_icu" label="Extra ICU Module"/>
<suffix name="tab_ui" label="Tab Management Module"/> <suffix name="tab_ui" label="Tab Management Module"/>
<suffix name="test_dummy" label="Test Dummy Module"/> <suffix name="test_dummy" label="Test Dummy Module"/>
<suffix name="vr" label="Virtual Reality Module"/> <suffix name="vr" label="Virtual Reality Module"/>
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