summaryrefslogtreecommitdiff
path: root/chromium/java/com/android/webview
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-10-14 13:54:41 +0100
committerTorne (Richard Coles) <torne@google.com>2014-10-14 13:54:41 +0100
commit15fda1d3fb8d694d7064ebfea7dba42e6131bfd1 (patch)
treedd0745b44949033ee4d5d19108ac6d1c4f6630a5 /chromium/java/com/android/webview
parent0acf378591b1e0f2c5ce29a6423723776fe2909e (diff)
parent6e1c4b73734f318061496c80853684e316c2d20d (diff)
downloadwebview-15fda1d3fb8d694d7064ebfea7dba42e6131bfd1.tar.gz
Merge glue layer from master-chromium.
Bring in the following CLs: Import translations. DO NOT MERGE Match removal of config_webSettingsDefaultTextEncoding. Add strings for Play Store text. Use overridden resources. Cherry-pick: Fix resource rewriting in apps with other shared libs. No changes to Chromium are required; these are all glue-layer only changes.
Diffstat (limited to 'chromium/java/com/android/webview')
-rw-r--r--chromium/java/com/android/webview/chromium/ResourceRewriter.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/chromium/java/com/android/webview/chromium/ResourceRewriter.java b/chromium/java/com/android/webview/chromium/ResourceRewriter.java
index 99fa46f..683277a 100644
--- a/chromium/java/com/android/webview/chromium/ResourceRewriter.java
+++ b/chromium/java/com/android/webview/chromium/ResourceRewriter.java
@@ -19,9 +19,6 @@ package com.android.webview.chromium;
import android.content.Context;
import android.util.SparseArray;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
/**
* Helper class used to fix up resource ids.
* This is mostly a copy of the code in frameworks/base/core/java/android/app/LoadedApk.java.
@@ -31,25 +28,28 @@ import java.lang.reflect.Modifier;
class ResourceRewriter {
public static void rewriteRValues(Context ctx) {
- // Rewrite the R 'constants' for all library apks.
+ // Rewrite the R 'constants' for the WebView library apk.
SparseArray<String> packageIdentifiers = ctx.getResources().getAssets()
.getAssignedPackageIdentifiers();
final int N = packageIdentifiers.size();
for (int i = 0; i < N; i++) {
- final int id = packageIdentifiers.keyAt(i);
- if (id == 0x01 || id == 0x7f) {
- continue;
- }
+ final String name = packageIdentifiers.valueAt(i);
- // TODO: We should use jarjar to remove the redundant R classes here, but due
- // to a bug in jarjar it's not possible to rename classes with '$' in their name.
- // See b/15684775.
- com.android.webview.chromium.R.onResourcesLoaded(id);
- org.chromium.ui.R.onResourcesLoaded(id);
- org.chromium.content.R.onResourcesLoaded(id);
+ // The resources are always called com.android.webview even if the manifest has had the
+ // package renamed.
+ if ("com.android.webview".equals(name)) {
+ final int id = packageIdentifiers.keyAt(i);
- break;
+ // TODO: We should use jarjar to remove the redundant R classes here, but due
+ // to a bug in jarjar it's not possible to rename classes with '$' in their name.
+ // See b/15684775.
+ com.android.webview.chromium.R.onResourcesLoaded(id);
+ org.chromium.ui.R.onResourcesLoaded(id);
+ org.chromium.content.R.onResourcesLoaded(id);
+
+ break;
+ }
}
}
}