[aapt2] Add DynamicRefTable to dump resources
aapt used to print the referenced packages table
in the dump resources command, add the same to aapt2
Bug: 279529151
Test: unit tests
Change-Id: If1d577ae85ab76f2a7cbcfe4b9087e49bd540572
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index bb286a8..61e399c 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -307,6 +307,11 @@
// order.
ResourceTableView GetPartitionedView(const ResourceTableViewOptions& options = {}) const;
+ using ReferencedPackages = std::map<uint8_t, std::string>;
+ const ReferencedPackages& GetReferencedPackages() const {
+ return included_packages_;
+ }
+
struct SearchResult {
ResourceTablePackage* package;
ResourceTableType* type;
@@ -342,7 +347,7 @@
// Set of dynamic packages that this table may reference. Their package names get encoded
// into the resources.arsc along with their compile-time assigned IDs.
- std::map<size_t, std::string> included_packages_;
+ ReferencedPackages included_packages_;
private:
DISALLOW_COPY_AND_ASSIGN(ResourceTable);