From f1642d87c5cc6783f5ef16e3cbadbd098f086111 Mon Sep 17 00:00:00 2001 From: yingying Date: Thu, 4 Sep 2014 10:36:54 +0800 Subject: base: Fix the problems for runtime overlay. - There is no need to make the string blocking when adding the asset path, as it will be made by the resources. - After adding the overlay path, it also needs to update the string blocks. - Scan all the sub folders for framework overlay res. Change-Id: Iaad019111ae364c319e58dce57dbf4647b38d4c3 CRs-Fixed: 763809 --- core/java/android/content/res/AssetManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/java/android/content/res') diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java index 8d96f5c..17b662a 100644 --- a/core/java/android/content/res/AssetManager.java +++ b/core/java/android/content/res/AssetManager.java @@ -612,7 +612,9 @@ public final class AssetManager implements AutoCloseable { public final int addAssetPath(String path) { synchronized (this) { int res = addAssetPathNative(path); - makeStringBlocks(mStringBlocks); + if (mStringBlocks != null) { + makeStringBlocks(mStringBlocks); + } return res; } } @@ -627,11 +629,12 @@ public final class AssetManager implements AutoCloseable { * * {@hide} */ - public final int addOverlayPath(String idmapPath) { synchronized (this) { int res = addOverlayPathNative(idmapPath); - makeStringBlocks(mStringBlocks); + if (mStringBlocks != null) { + makeStringBlocks(mStringBlocks); + } return res; } } -- cgit v1.1