diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2020-06-05 16:11:20 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-05 16:11:20 +0000 |
commit | 1b4cda227abd29b438cbe037d4c35400f6e7eed8 (patch) | |
tree | 12f272a73f3125006f4102488d3812de45245208 /tools/aapt2/Debug.cpp | |
parent | 187c2f86b8270500510ab220a110dda0843087c9 (diff) | |
parent | 2201f8b6269f88951762851e665cd781cc7f1b10 (diff) |
Merge "Add policies and enforce overlayable to header" into rvc-dev am: 2201f8b626
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11481145
Change-Id: I71ff9f46e1e5a5016291a062dd5389078527588f
Diffstat (limited to 'tools/aapt2/Debug.cpp')
-rw-r--r-- | tools/aapt2/Debug.cpp | 25 |
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}); |