Skip to content

Commit

Permalink
[Chromecast] Include locale resources on Android.
Browse files Browse the repository at this point in the history
Before, we weren't packaging localized pak files with the Android cast
shell, and ResourceBundle wasn't looking in the APK assets for these pak
files.

Bug: internal b/70031131
Test: CQ and tried it out with an Android build
Change-Id: I65adbaf552dfce6be62c4c4035d221f42b330c4d
Reviewed-on: https://chromium-review.googlesource.com/807406
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Commit-Queue: Thoren Paulson <thoren@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521807}
  • Loading branch information
Thoren Paulson authored and Commit Bot committed Dec 5, 2017
1 parent 57a9b3e commit 0bf75bf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions chromecast/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ if (is_android) {
output = "$root_gen_dir/chromecast/android/${target_name}.h"
exception_files = jni_exception_files
}

android_assets("cast_shell_apk_assets") {
assert(v8_use_external_startup_data)

Expand All @@ -565,13 +566,31 @@ if (is_android) {
]

deps = [
":cast_shell_apk_locale_assets",
":cast_shell_pak",
"//third_party/icu:icu_assets",
"//v8:v8_external_startup_data_assets",
]
disable_compression = true
}

android_assets("cast_shell_apk_locale_assets") {
renaming_sources = []
renaming_destinations = []

foreach(locale, cast_locales) {
renaming_sources += [ "$root_out_dir/chromecast_locales/${locale}.pak" ]
renaming_destinations += [ "stored-locales/${locale}.pak" ]
}

deps = [
":chromecast_locales_pak",
]

treat_as_locale_paks = true
disable_compression = true
}

android_apk("cast_shell_apk") {
apk_name = "CastShell"
android_manifest = "$root_gen_dir/cast_shell_manifest/AndroidManifest.xml"
Expand Down
3 changes: 3 additions & 0 deletions chromecast/app/cast_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "base/android/apk_assets.h"
#include "chromecast/app/android/cast_crash_reporter_client_android.h"
#include "chromecast/app/android/crash_handler.h"
#include "ui/base/resource/resource_bundle_android.h"
#elif defined(OS_LINUX)
#include "chromecast/app/linux/cast_crash_reporter_client.h"
#endif // defined(OS_LINUX)
Expand Down Expand Up @@ -203,6 +204,8 @@ void CastMainDelegate::InitializeResourceBundle() {
DCHECK_GE(pak_fd, 0);
global_descriptors->Set(kAndroidPakDescriptor, pak_fd, pak_region);
}

ui::SetLocalePaksStoredInApk(true);
#endif // defined(OS_ANDROID)

resource_delegate_.reset(new CastResourceDelegate());
Expand Down

0 comments on commit 0bf75bf

Please sign in to comment.