From e4e989ccba19f9bfad44d070873d67e7a3fd29c4 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Mon, 29 Oct 2018 02:21:50 -0700 Subject: RRO: Added partition policies for overlays tags can now have policy elements that indicate which partition the overlay apk must reside on in order to be allowed to overlay a resource. This change only adds parsing of and encoding of policy in the proto ResourceTable. A later change will add the encoding of policy and overlayable in the binary APK. Bug: 110869880 Test: make aapt2_tests Change-Id: I8d4ed7b0e01f981149c6e3190af1681073b79b03 --- tools/aapt2/Debug.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'tools/aapt2/Debug.cpp') diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp index 0a517ab8a2de..0bc5221245ca 100644 --- a/tools/aapt2/Debug.cpp +++ b/tools/aapt2/Debug.cpp @@ -306,8 +306,29 @@ void Debug::PrintTable(const ResourceTable& table, const DebugPrintTableOptions& break; } - if (entry->overlayable) { - printer->Print(" OVERLAYABLE"); + for (size_t i = 0; i < entry->overlayable_declarations.size(); i++) { + printer->Print((i == 0) ? " " : "|"); + printer->Print("OVERLAYABLE"); + + if (entry->overlayable_declarations[i].policy) { + switch (entry->overlayable_declarations[i].policy.value()) { + case Overlayable::Policy::kProduct: + printer->Print("_PRODUCT"); + break; + case Overlayable::Policy::kProductServices: + printer->Print("_PRODUCT_SERVICES"); + break; + case Overlayable::Policy::kSystem: + printer->Print("_SYSTEM"); + break; + case Overlayable::Policy::kVendor: + printer->Print("_VENDOR"); + break; + case Overlayable::Policy::kPublic: + printer->Print("_PUBLIC"); + break; + } + } } printer->Println(); -- cgit v1.2.3-59-g8ed1b