From fb6312fe93a8544e6a95d1c619c8cea3940cbe1a Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 28 Jun 2016 14:40:32 -0700 Subject: AAPT2: Add version collapsing When an app specifies (or imports) resources with various configurations for different SDK versions, specifying a minSdk will make many of those resources unreachable. Version collapsing will prune out the resources specified for SDK versions less than the minSdk. If, however, there is no exact matching resource for the minSdk version, the next smallest SDK version is kept. Change-Id: Ic7bcab6c59d65c97c67c8767358abb57cdec60a4 --- tools/aapt2/SdkConstants.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/aapt2/SdkConstants.cpp') diff --git a/tools/aapt2/SdkConstants.cpp b/tools/aapt2/SdkConstants.cpp index c2a22bf2a373..7312ee3b5b20 100644 --- a/tools/aapt2/SdkConstants.cpp +++ b/tools/aapt2/SdkConstants.cpp @@ -23,6 +23,9 @@ namespace aapt { +static const char16_t* sDevelopmentSdkCodeName = u"O"; +static int sDevelopmentSdkLevel = 26; + static const std::vector> sAttrIdMap = { { 0x021c, 1 }, { 0x021d, 2 }, @@ -735,4 +738,8 @@ size_t findAttributeSdkLevel(const ResourceName& name) { return SDK_LOLLIPOP_MR1; } +std::pair getDevelopmentSdkCodeNameAndVersion() { + return std::make_pair(StringPiece16(sDevelopmentSdkCodeName), sDevelopmentSdkLevel); +} + } // namespace aapt -- cgit v1.2.3-59-g8ed1b