From e59f0d80ec19249f72c07ae191ad673d040443e3 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Fri, 13 Oct 2017 09:36:53 -0700 Subject: AAPT2: Enable building proto artifacts - This will allow the bundle tool to ingest the outputs of the aapt2 link phase. Bug: 64143208 Test: manual Change-Id: I1a4b3ce5c2ffbbdc4bc642c3371a9ef2e7e9ad71 --- tools/aapt2/ResourceUtils.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tools/aapt2/ResourceUtils.cpp') diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp index 6fac6e9dfefe..24187d96fec5 100644 --- a/tools/aapt2/ResourceUtils.cpp +++ b/tools/aapt2/ResourceUtils.cpp @@ -704,8 +704,15 @@ std::unique_ptr ParseBinaryResValue(const ResourceType& type, const Config } else { if (type != ResourceType::kString && util::StartsWith(str, "res/")) { // This must be a FileReference. - return util::make_unique(dst_pool->MakeRef( - str, StringPool::Context(StringPool::Context::kHighPriority, config))); + std::unique_ptr file_ref = + util::make_unique(dst_pool->MakeRef( + str, StringPool::Context(StringPool::Context::kHighPriority, config))); + if (util::EndsWith(*file_ref->path, ".xml")) { + file_ref->type = ResourceFile::Type::kBinaryXml; + } else if (util::EndsWith(*file_ref->path, ".png")) { + file_ref->type = ResourceFile::Type::kPng; + } + return std::move(file_ref); } // There are no styles associated with this string, so treat it as a simple string. -- cgit v1.2.3-59-g8ed1b