diff options
| author | Adam Lesinski <adamlesinski@google.com> | 2014-08-15 22:07:59 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-08-15 22:07:59 +0000 |
| commit | ab9b1f5b2a12352f901520445d113cbdd570cc95 (patch) | |
| tree | 3ee20b2c6b038a7596751dbd6999ca82e02a678c /core/java/android | |
| parent | a4dd2c336f289b67d194056b9d4acd9ab5676ab5 (diff) | |
| parent | 9e4056b7af8c2297bd86983607d3fe3f01464e35 (diff) | |
| download | frameworks_base-ab9b1f5b2a12352f901520445d113cbdd570cc95.zip frameworks_base-ab9b1f5b2a12352f901520445d113cbdd570cc95.tar.gz frameworks_base-ab9b1f5b2a12352f901520445d113cbdd570cc95.tar.bz2 | |
am 5bcfb6b9: am 2fdf2db8: Merge "Fix assumption about DynamicRefTable in aapt" into lmp-dev
* commit '5bcfb6b98261c94a6ff33438e6b29ca71bb3c0eb':
Fix assumption about DynamicRefTable in aapt
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/LoadedApk.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java index fcfc1c4..e0c7816 100644 --- a/core/java/android/app/LoadedApk.java +++ b/core/java/android/app/LoadedApk.java @@ -40,6 +40,7 @@ import android.os.StrictMode; import android.os.Trace; import android.os.UserHandle; import android.util.AndroidRuntimeException; +import android.util.Log; import android.util.Slog; import android.util.SparseArray; import android.view.DisplayAdjustments; @@ -643,8 +644,17 @@ public final class LoadedApk { } private void rewriteRValues(ClassLoader cl, String packageName, int id) { + final Class<?> rClazz; + try { + rClazz = cl.loadClass(packageName + ".R"); + } catch (ClassNotFoundException e) { + // This is not necessarily an error, as some packages do not ship with resources + // (or they do not need rewriting). + Log.i(TAG, "Could not find R class for package '" + packageName + "'"); + return; + } + try { - final Class<?> rClazz = cl.loadClass(packageName + ".R"); Class<?>[] declaredClasses = rClazz.getDeclaredClasses(); for (Class<?> clazz : declaredClasses) { try { |
