Commit 9693ccf3 authored by Clark DuVall's avatar Clark DuVall Committed by Chromium LUCI CQ

[WebLayer] Increase hardcoded package ID for WebLayer

This increases the package ID of WebLayer in standalone WebView, since
it seems some devices are already using the 0x0c package ID.

Bug: 1128591
Change-Id: Ib5aa17f9d997e3cf9e6611f651610238b796a07e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566294Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832168}
parent 8bfe7524
...@@ -33,7 +33,7 @@ _FLAT_ARSC_HEADER = 'AAPT\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00' ...@@ -33,7 +33,7 @@ _FLAT_ARSC_HEADER = 'AAPT\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00'
# The package ID hardcoded for shared libraries. See # The package ID hardcoded for shared libraries. See
# _HardcodeSharedLibraryDynamicAttributes() for more details. If this value # _HardcodeSharedLibraryDynamicAttributes() for more details. If this value
# changes make sure to change REQUIRED_PACKAGE_IDENTIFIER in WebLayerImpl.java. # changes make sure to change REQUIRED_PACKAGE_IDENTIFIER in WebLayerImpl.java.
SHARED_LIBRARY_HARDCODED_ID = 12 SHARED_LIBRARY_HARDCODED_ID = 36
def _ProcessZip(zip_path, process_func): def _ProcessZip(zip_path, process_func):
......
...@@ -10,7 +10,7 @@ import android.content.Context; ...@@ -10,7 +10,7 @@ import android.content.Context;
* Util class for dealing with resources. * Util class for dealing with resources.
*/ */
public class ResourceUtil { public class ResourceUtil {
public static final int REQUIRED_PACKAGE_IDENTIFIER = 12; public static final int REQUIRED_PACKAGE_IDENTIFIER = 36;
private ResourceUtil() {} private ResourceUtil() {}
......
...@@ -118,7 +118,7 @@ public final class WebLayerImpl extends IWebLayer.Stub { ...@@ -118,7 +118,7 @@ public final class WebLayerImpl extends IWebLayer.Stub {
// The required package ID for WebLayer when loaded as a shared library, hardcoded in the // The required package ID for WebLayer when loaded as a shared library, hardcoded in the
// resources. If this value changes make sure to change _SHARED_LIBRARY_HARDCODED_ID in // resources. If this value changes make sure to change _SHARED_LIBRARY_HARDCODED_ID in
// //build/android/gyp/util/protoresources.py. // //build/android/gyp/util/protoresources.py.
private static final int REQUIRED_PACKAGE_IDENTIFIER = 12; private static final int REQUIRED_PACKAGE_IDENTIFIER = 36;
private final ProfileManager mProfileManager = new ProfileManager(); private final ProfileManager mProfileManager = new ProfileManager();
...@@ -669,6 +669,10 @@ public final class WebLayerImpl extends IWebLayer.Stub { ...@@ -669,6 +669,10 @@ public final class WebLayerImpl extends IWebLayer.Stub {
/** Forces adding entries to the package identifiers array until we hit the required ID. */ /** Forces adding entries to the package identifiers array until we hit the required ID. */
private static void forceAddAssetPaths(Context remoteContext, int packageId) { private static void forceAddAssetPaths(Context remoteContext, int packageId) {
if (packageId > REQUIRED_PACKAGE_IDENTIFIER) {
throw new AndroidRuntimeException(
"WebLayer package ID too large, aborting: " + packageId);
}
try { try {
Method addAssetPath = AssetManager.class.getMethod("addAssetPath", String.class); Method addAssetPath = AssetManager.class.getMethod("addAssetPath", String.class);
String path = remoteContext.getApplicationInfo().sourceDir; String path = remoteContext.getApplicationInfo().sourceDir;
......
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