diff options
Diffstat (limited to 'src/com/android/browser')
-rw-r--r-- | src/com/android/browser/homepages/RequestHandler.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/homepages/Template.java | 4 | ||||
-rw-r--r-- | src/com/android/browser/search/SearchEngineInfo.java | 5 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/browser/homepages/RequestHandler.java b/src/com/android/browser/homepages/RequestHandler.java index 248bf53..e0a0eac 100644 --- a/src/com/android/browser/homepages/RequestHandler.java +++ b/src/com/android/browser/homepages/RequestHandler.java @@ -115,7 +115,8 @@ public class RequestHandler extends Thread { void writeResource(String fileName) throws IOException {
Resources res = mContext.getResources();
- int id = res.getIdentifier(fileName, null, mContext.getPackageName());
+ String packageName = R.class.getPackage().getName();
+ int id = res.getIdentifier(fileName, null, packageName);
if (id != 0) {
InputStream in = res.openRawResource(id);
byte[] buf = new byte[4096];
diff --git a/src/com/android/browser/homepages/Template.java b/src/com/android/browser/homepages/Template.java index c1a6b0e..e918b07 100644 --- a/src/com/android/browser/homepages/Template.java +++ b/src/com/android/browser/homepages/Template.java @@ -30,6 +30,8 @@ import android.content.res.Resources; import android.database.Cursor;
import android.util.TypedValue;
+import com.android.browser.R;
+
public class Template {
private static HashMap<Integer, Template> sCachedTemplates = new HashMap<Integer, Template>();
@@ -234,7 +236,7 @@ public class Template { private static String replaceConsts(Context context, String template) {
final Pattern pattern = Pattern.compile("<%@\\s*(\\w+/\\w+)\\s*%>");
final Resources res = context.getResources();
- final String packageName = context.getPackageName();
+ final String packageName = R.class.getPackage().getName();
Matcher m = pattern.matcher(template);
StringBuffer sb = new StringBuffer();
while (m.find()) {
diff --git a/src/com/android/browser/search/SearchEngineInfo.java b/src/com/android/browser/search/SearchEngineInfo.java index af6fa70..ec304f6 100644 --- a/src/com/android/browser/search/SearchEngineInfo.java +++ b/src/com/android/browser/search/SearchEngineInfo.java @@ -21,6 +21,8 @@ import android.content.res.Resources.NotFoundException; import android.text.TextUtils; import android.util.Log; +import com.android.browser.R; + import java.net.URLEncoder; import java.util.Arrays; import java.util.Locale; @@ -61,7 +63,8 @@ public class SearchEngineInfo { mName = name; Resources res = context.getResources(); - int id_data = res.getIdentifier(name, "array", context.getPackageName()); + String packageName = R.class.getPackage().getName(); + int id_data = res.getIdentifier(name, "array", packageName); if (id_data == 0) { throw new IllegalArgumentException("No resources found for " + name); } |