Loading core/java/android/content/res/AssetManager.java +15 −1 Original line number Diff line number Diff line Loading @@ -627,7 +627,21 @@ public final class AssetManager implements AutoCloseable { * * {@hide} */ public native final int addOverlayPath(String idmapPath); public final int addOverlayPath(String idmapPath) { synchronized (this) { int res = addOverlayPathNative(idmapPath); makeStringBlocks(mStringBlocks); return res; } } /** * See addOverlayPath. * * {@hide} */ public native final int addOverlayPathNative(String idmapPath); /** * Add multiple sets of assets to the asset manager at once. See Loading core/jni/android_util_AssetManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2039,7 +2039,7 @@ static JNINativeMethod gAssetManagerMethods[] = { (void*) android_content_AssetManager_getAssetRemainingLength }, { "addAssetPathNative", "(Ljava/lang/String;)I", (void*) android_content_AssetManager_addAssetPath }, { "addOverlayPath", "(Ljava/lang/String;)I", { "addOverlayPathNative", "(Ljava/lang/String;)I", (void*) android_content_AssetManager_addOverlayPath }, { "isUpToDate", "()Z", (void*) android_content_AssetManager_isUpToDate }, Loading libs/androidfw/AssetManager.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,10 @@ bool AssetManager::addOverlayPath(const String8& packagePath, int32_t* cookie) mAssetPaths.add(oap); *cookie = static_cast<int32_t>(mAssetPaths.size()); if (mResources != NULL) { appendPathToResTable(oap); } return true; } Loading libs/androidfw/ResourceTypes.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -6237,14 +6237,14 @@ status_t ResTable::createIdmap(const ResTable& overlay, } if (typeMap.entryOffset + typeMap.entryMap.size() < entryIndex) { // Resize to accomodate this entry and the 0's in between. if (typeMap.entryMap.resize((entryIndex - typeMap.entryOffset) + 1) < 0) { // pad with 0xffffffff's (indicating non-existing entries) before adding this entry size_t index = typeMap.entryMap.size(); size_t numItems = entryIndex - (typeMap.entryOffset + index); if (typeMap.entryMap.insertAt(0xffffffff, index, numItems) < 0) { return NO_MEMORY; } typeMap.entryMap.editTop() = Res_GETENTRY(overlayResID); } else { typeMap.entryMap.add(Res_GETENTRY(overlayResID)); } typeMap.entryMap.add(Res_GETENTRY(overlayResID)); } if (!typeMap.entryMap.isEmpty()) { Loading Loading
core/java/android/content/res/AssetManager.java +15 −1 Original line number Diff line number Diff line Loading @@ -627,7 +627,21 @@ public final class AssetManager implements AutoCloseable { * * {@hide} */ public native final int addOverlayPath(String idmapPath); public final int addOverlayPath(String idmapPath) { synchronized (this) { int res = addOverlayPathNative(idmapPath); makeStringBlocks(mStringBlocks); return res; } } /** * See addOverlayPath. * * {@hide} */ public native final int addOverlayPathNative(String idmapPath); /** * Add multiple sets of assets to the asset manager at once. See Loading
core/jni/android_util_AssetManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -2039,7 +2039,7 @@ static JNINativeMethod gAssetManagerMethods[] = { (void*) android_content_AssetManager_getAssetRemainingLength }, { "addAssetPathNative", "(Ljava/lang/String;)I", (void*) android_content_AssetManager_addAssetPath }, { "addOverlayPath", "(Ljava/lang/String;)I", { "addOverlayPathNative", "(Ljava/lang/String;)I", (void*) android_content_AssetManager_addOverlayPath }, { "isUpToDate", "()Z", (void*) android_content_AssetManager_isUpToDate }, Loading
libs/androidfw/AssetManager.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,10 @@ bool AssetManager::addOverlayPath(const String8& packagePath, int32_t* cookie) mAssetPaths.add(oap); *cookie = static_cast<int32_t>(mAssetPaths.size()); if (mResources != NULL) { appendPathToResTable(oap); } return true; } Loading
libs/androidfw/ResourceTypes.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -6237,14 +6237,14 @@ status_t ResTable::createIdmap(const ResTable& overlay, } if (typeMap.entryOffset + typeMap.entryMap.size() < entryIndex) { // Resize to accomodate this entry and the 0's in between. if (typeMap.entryMap.resize((entryIndex - typeMap.entryOffset) + 1) < 0) { // pad with 0xffffffff's (indicating non-existing entries) before adding this entry size_t index = typeMap.entryMap.size(); size_t numItems = entryIndex - (typeMap.entryOffset + index); if (typeMap.entryMap.insertAt(0xffffffff, index, numItems) < 0) { return NO_MEMORY; } typeMap.entryMap.editTop() = Res_GETENTRY(overlayResID); } else { typeMap.entryMap.add(Res_GETENTRY(overlayResID)); } typeMap.entryMap.add(Res_GETENTRY(overlayResID)); } if (!typeMap.entryMap.isEmpty()) { Loading