summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-05-13 14:17:52 -0700
committerRyan Mitchell <rtmitchell@google.com>2020-06-01 16:15:35 -0700
commita707013b78cea3586fdadf9a2f04932e823d7504 (patch)
treeeb8fd2f2d2872d3fb519f79309907415b6d7bdda /tools
parent57e977a5859ff24f5ff909046dccde5bce341f6d (diff)
Add policies and enforce overlayable to header
If the fulfilled policies change without the contents of the target and overlay APKs changing, the idmap for the overlay should be regenerated. This change adds fulfilled policies and enforce overlayable to the idmap header so that idmap2d can determine if the polices or enforce overlayable changed from what was used to generate the idmap. Bug: 119328308 Test: idmap2_tests Test: atest RegenerateIdmapTest Change-Id: I96f970e82b5243be01b205ac2cb6ab249c6100bc
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt2/Debug.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp
index 1eb7d95f381a..439f231193df 100644
--- a/tools/aapt2/Debug.cpp
+++ b/tools/aapt2/Debug.cpp
@@ -252,29 +252,6 @@ class ValueBodyPrinter : public ConstValueVisitor {
Printer* printer_;
};
-std::string OverlayablePoliciesToString(PolicyFlags policies) {
- std::string str;
-
- uint32_t remaining = policies;
- for (auto const& policy : kPolicyStringToFlag) {
- if ((policies & policy.second) != policy.second) {
- continue;
- }
- if (!str.empty()) {
- str.append("|");
- }
- str.append(policy.first.data());
- remaining &= ~policy.second;
- }
- if (remaining != 0) {
- if (!str.empty()) {
- str.append("|");
- }
- str.append(StringPrintf("0x%08x", remaining));
- }
- return !str.empty() ? str : "none";
-}
-
} // namespace
void Debug::PrintTable(const ResourceTable& table, const DebugPrintTableOptions& options,
@@ -575,7 +552,7 @@ void Debug::DumpOverlayable(const ResourceTable& table, text::Printer* printer)
overlayable_item.overlayable->name.c_str(),
overlayable_item.overlayable->actor.c_str());
const auto policy_subsection = StringPrintf(R"(policies="%s")",
- OverlayablePoliciesToString(overlayable_item.policies).c_str());
+ android::idmap2::policy::PoliciesToDebugString(overlayable_item.policies).c_str());
const auto value =
StringPrintf("%s/%s", to_string(type->type).data(), entry->name.c_str());
items.push_back(DumpOverlayableEntry{overlayable_section, policy_subsection, value});