From 76da37e1cf5c1381d9ccbaca86463fca52bd40f5 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 19 May 2016 18:25:28 -0700 Subject: Performance improvements in AssetManager Change the implementation of getLocales() to iterate the set of configurations using a templated method, instead of using the result of getConfigurations(). Also remove the check for AndroidManifest.xml when adding an asset path. This is unneccessary. Bug:28625993 Change-Id: I16de5da598d0c371421d1dc8eee054dce9baf53a --- libs/androidfw/AssetManager.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'libs/androidfw/AssetManager.cpp') diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index 715c875d064d..f50cff4387d2 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -66,7 +66,6 @@ static const char* kAssetsRoot = "assets"; static const char* kAppZipName = NULL; //"classes.jar"; static const char* kSystemAssets = "framework/framework-res.apk"; static const char* kResourceCache = "resource-cache"; -static const char* kAndroidManifest = "AndroidManifest.xml"; static const char* kExcludeExtension = ".EXCLUDE"; @@ -203,16 +202,6 @@ bool AssetManager::addAssetPath( ALOGV("In %p Asset %s path: %s", this, ap.type == kFileTypeDirectory ? "dir" : "zip", ap.path.string()); - // Check that the path has an AndroidManifest.xml - Asset* manifestAsset = const_cast(this)->openNonAssetInPathLocked( - kAndroidManifest, Asset::ACCESS_BUFFER, ap); - if (manifestAsset == NULL) { - // This asset path does not contain any resources. - delete manifestAsset; - return false; - } - delete manifestAsset; - ap.isSystemAsset = isSystemAsset; mAssetPaths.add(ap); -- cgit v1.2.3-59-g8ed1b