summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-03-16 22:16:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-16 22:16:04 +0000
commit9c329b8b6440823ef94bffebc0b1098e8b2ad622 (patch)
tree4f60ebd5b4b7489645afc1866dc03995202a0812 /core/java/android/app
parenta501a021c38bb3f8c937886f1abaa68f822f95dd (diff)
parent1dd50c54b5ca05531676e4542971b91ed023a792 (diff)
downloadframeworks_base-9c329b8b6440823ef94bffebc0b1098e8b2ad622.zip
frameworks_base-9c329b8b6440823ef94bffebc0b1098e8b2ad622.tar.gz
frameworks_base-9c329b8b6440823ef94bffebc0b1098e8b2ad622.tar.bz2
Merge "Only attempt to load .apk files in AssetManager"
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/ResourcesManager.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index 8abe223..79797c9 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -27,6 +27,7 @@ import android.content.res.ResourcesKey;
import android.hardware.display.DisplayManagerGlobal;
import android.util.ArrayMap;
import android.util.DisplayMetrics;
+import android.util.Log;
import android.util.Pair;
import android.util.Slog;
import android.view.Display;
@@ -164,7 +165,7 @@ public class ResourcesManager {
WeakReference<Resources> wr = mActiveResources.get(key);
r = wr != null ? wr.get() : null;
- //if (r != null) Slog.i(TAG, "isUpToDate " + resDir + ": " + r.getAssets().isUpToDate());
+ //if (r != null) Log.i(TAG, "isUpToDate " + resDir + ": " + r.getAssets().isUpToDate());
if (r != null && r.getAssets().isUpToDate()) {
if (DEBUG) Slog.w(TAG, "Returning cached resources " + r + " " + resDir
+ ": appScale=" + r.getCompatibilityInfo().applicationScale
@@ -174,7 +175,7 @@ public class ResourcesManager {
}
//if (r != null) {
- // Slog.w(TAG, "Throwing away out-of-date resources!!!! "
+ // Log.w(TAG, "Throwing away out-of-date resources!!!! "
// + r + " " + resDir);
//}
@@ -204,14 +205,18 @@ public class ResourcesManager {
if (libDirs != null) {
for (String libDir : libDirs) {
- if (assets.addAssetPath(libDir) == 0) {
- Slog.w(TAG, "Asset path '" + libDir +
- "' does not exist or contains no resources.");
+ if (libDir.endsWith(".apk")) {
+ // Avoid opening files we know do not have resources,
+ // like code-only .jar files.
+ if (assets.addAssetPath(libDir) == 0) {
+ Log.w(TAG, "Asset path '" + libDir +
+ "' does not exist or contains no resources.");
+ }
}
}
}
- //Slog.i(TAG, "Resource: key=" + key + ", display metrics=" + metrics);
+ //Log.i(TAG, "Resource: key=" + key + ", display metrics=" + metrics);
DisplayMetrics dm = getDisplayMetricsLocked(displayId);
Configuration config;
final boolean isDefaultDisplay = (displayId == Display.DEFAULT_DISPLAY);