diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2020-12-02 11:43:18 -0800 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2021-01-06 16:19:53 -0800 |
commit | 30dc2e01714a50e3816efa3bd347d1bf783fa0a5 (patch) | |
tree | eb97cf1c5b8be1bdb9c48885e4b5eb44560067c4 /cmds/idmap2/idmap2d/Idmap2Service.cpp | |
parent | 0699f1de6a684644b2debf82d55dfbcbc9387679 (diff) |
Accept --overlay-name flag in idmap2
To support allowing for multiple <overlay> tags in one package, idmap2
must be able to generate an idmap for an individual <overlay> tag.
`idmap2 create` now accepts a --overlay-name flag that specifies which
tag to use to generate the idmap. The value of --overlay-name should be
set to the value of the android:name attribute on the <overlay> tag to
use.
If the flag is not present, idmap2 will look for an <overlay> tag with
no value for android:name.
Bug: 162841629
Test: libandroidfw_tests
Test: libidmap2_tests
Change-Id: I02316d0b88773f02c04a5d462be9825016fa496d
Diffstat (limited to 'cmds/idmap2/idmap2d/Idmap2Service.cpp')
-rw-r--r-- | cmds/idmap2/idmap2d/Idmap2Service.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds/idmap2/idmap2d/Idmap2Service.cpp b/cmds/idmap2/idmap2d/Idmap2Service.cpp index 8a7272c073b9..93537d32299b 100644 --- a/cmds/idmap2/idmap2d/Idmap2Service.cpp +++ b/cmds/idmap2/idmap2d/Idmap2Service.cpp @@ -155,8 +155,9 @@ Status Idmap2Service::verifyIdmap(const std::string& target_apk_path, return overlay_crc_status; } + // TODO(162841629): Support passing overlay name to idmap2d verify auto up_to_date = - header->IsUpToDate(target_apk_path overlay_apk_path, target_crc, overlay_crc, + header->IsUpToDate(target_apk_path, overlay_apk_path, "", target_crc, overlay_crc, ConvertAidlArgToPolicyBitmask(fulfilled_policies), enforce_overlayable); *_aidl_return = static_cast<bool>(up_to_date); @@ -190,8 +191,9 @@ Status Idmap2Service::createIdmap(const std::string& target_apk_path, return error("failed to load apk " + overlay_apk_path); } + // TODO(162841629): Support passing overlay name to idmap2d create const auto idmap = - Idmap::FromApkAssets(*target_apk, *overlay_apk, policy_bitmask, enforce_overlayable); + Idmap::FromApkAssets(*target_apk, *overlay_apk, "", policy_bitmask, enforce_overlayable); if (!idmap) { return error(idmap.GetErrorMessage()); } |