summaryrefslogtreecommitdiff
path: root/libs/androidfw/ApkAssets.cpp
diff options
context:
space:
mode:
author Ryan Mitchell <rtmitchell@google.com> 2021-02-10 18:06:54 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-10 18:06:54 +0000
commit1c319ea03fe7c1ec5f64ec057bc51be2a6f6e9dc (patch)
tree3b83450121bdde02afb6d00a7df02b9c3adc9758 /libs/androidfw/ApkAssets.cpp
parent0177fad8455366e9e43f64e12c924b8901899e56 (diff)
parent6a2ca782d497e6fdb616f6a273409786a0b81f99 (diff)
Merge changes I0539656f,I4c9f29da,Iac679828 into sc-dev
* changes: OverlayManager Fabricated RROs Add fabricated RRO generation to libidmap2 Query overlays using package and name
Diffstat (limited to 'libs/androidfw/ApkAssets.cpp')
-rwxr-xr-xlibs/androidfw/ApkAssets.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp
index ca5981c0dd5c..9c743cea592a 100755
--- a/libs/androidfw/ApkAssets.cpp
+++ b/libs/androidfw/ApkAssets.cpp
@@ -83,8 +83,16 @@ std::unique_ptr<ApkAssets> ApkAssets::LoadOverlay(const std::string& idmap_path,
return {};
}
+ std::unique_ptr<AssetsProvider> overlay_assets;
const std::string overlay_path(loaded_idmap->OverlayApkPath());
- auto overlay_assets = ZipAssetsProvider::Create(overlay_path);
+ if (IsFabricatedOverlay(overlay_path)) {
+ // Fabricated overlays do not contain resource definitions. All of the overlay resource values
+ // are defined inline in the idmap.
+ overlay_assets = EmptyAssetsProvider::Create();
+ } else {
+ // The overlay should be an APK.
+ overlay_assets = ZipAssetsProvider::Create(overlay_path);
+ }
if (overlay_assets == nullptr) {
return {};
}