diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2020-06-05 16:07:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-05 16:07:28 +0000 |
commit | 2201f8b6269f88951762851e665cd781cc7f1b10 (patch) | |
tree | 82ae48349bd4ecc6a000b0b626cb66540f9efc0e /tools/aapt2/Debug.cpp | |
parent | abbdec4281405d5568951d6952a4e18b117ee2fa (diff) | |
parent | a707013b78cea3586fdadf9a2f04932e823d7504 (diff) |
Merge "Add policies and enforce overlayable to header" into rvc-dev
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}); |