Commit 7811575c authored by Trevor Perrier's avatar Trevor Perrier Committed by Commit Bot

[Android] call SplitCompat.installActivity on ContextUtils context

This CL aims to fix a bug with native resources not loading after a
locale override.

Currently, when an override language split is downloaded and applied
only Java resources load until Play Store daily hygiene runs and moves
the language split apks to `/data/app/` from `/data/data`.

To make resources available on a context SplitCompat.installActivity
should be called.

This CL calls SplitCompat.installActivity on the global application
context ContextUtils.  This context is used to load native resources in
ResourceBundle.getLocalePakResourcePath.

Bug: 1143026
Change-Id: I6cb05d2d3d45fe8aef9b0dfc8e193e00147d7e78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2503621
Commit-Queue: Trevor  Perrier <perrier@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821858}
parent 49efc765
......@@ -36,6 +36,7 @@ import org.chromium.chrome.browser.dependency_injection.DaggerChromeAppComponent
import org.chromium.chrome.browser.dependency_injection.ModuleFactoryOverrides;
import org.chromium.chrome.browser.flags.CachedFeatureFlags;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.language.AppLocaleUtils;
import org.chromium.chrome.browser.language.GlobalAppLocaleController;
import org.chromium.chrome.browser.metrics.UmaUtils;
import org.chromium.chrome.browser.night_mode.SystemNightModeMonitor;
......@@ -127,6 +128,11 @@ public class ChromeApplication extends SplitCompatApplication {
// Initializes the support for dynamic feature modules (browser only).
ModuleUtil.initApplication();
// Native resources are loaded from the application context in ContextUtils. These
// are need for app locale overrides, so ensure SplitCompat.installActivity is
// called on this context for bundle builds.
AppLocaleUtils.maybeInstallActivitySplitCompat(context);
// Set Chrome factory for mapping BackgroundTask classes to TaskIds.
ChromeBackgroundTaskFactory.setAsDefault();
......
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