Dependency injection of AssetProviders into ApkAssets
Creates ApkAssets creation methods that allow an AssetsProvider to be specified. During idmap verification and creation, idmap2 currently opens the target package and overlay package several times: 1) When the crc of the package is calculated in idmap2 verify 2) When the manifest of an overlay is parsed 3) When an ApkAssets is opened. Opening large zip files (like framework-res.apk) is slow. If we opened the zip one time as an ApkAssets, the resources.arsc would have to be parsed (which means mmaping/unmapping and touching a lot of resources.arsc pages). This would cause idmap2 to preform unnecessary work just to check the crc of some files. This change allows a ZipAssetsProvider to be created and then moved for the creation of an ApkAssets. The zip file only needs to be opened once and the resources.arsc is not parsed until reading resources is actually necessary. Bug: 172471315 Test: libandroidfw_tests Test: CtsResourcesLoaderTests Change-Id: I940bb2c13844c7f028776a623a9ecef45a4813bf
Loading
Please register or sign in to comment