diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2019-04-11 14:29:25 -0700 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2019-04-11 14:29:25 -0700 |
commit | 48002f631334833231b2c9e5b8e54de8c58fc9b1 (patch) | |
tree | e22403a14ed230772e87e5434a432f5e5fd60563 /tools/aapt2/SdkConstants.cpp | |
parent | d81cd2629666b0ed852142607852232094e04d11 (diff) |
qt-dev-plus-aosp designated for R. Update MAX_PLATFORM_VERSION, etc.
Test: aapt2_tests
Bug: 128934651
Change-Id: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
Diffstat (limited to 'tools/aapt2/SdkConstants.cpp')
-rw-r--r-- | tools/aapt2/SdkConstants.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/aapt2/SdkConstants.cpp b/tools/aapt2/SdkConstants.cpp index f4b0124abcda..b4b6ff1daaaa 100644 --- a/tools/aapt2/SdkConstants.cpp +++ b/tools/aapt2/SdkConstants.cpp @@ -18,15 +18,17 @@ #include <algorithm> #include <string> -#include <unordered_map> +#include <unordered_set> #include <vector> using android::StringPiece; namespace aapt { -static const char* sDevelopmentSdkCodeName = "Q"; static ApiVersion sDevelopmentSdkLevel = 10000; +static const auto sDevelopmentSdkCodeNames = std::unordered_set<StringPiece>({ + "Q", "R" +}); static const std::vector<std::pair<uint16_t, ApiVersion>> sAttrIdMap = { {0x021c, 1}, @@ -72,8 +74,9 @@ ApiVersion FindAttributeSdkLevel(const ResourceId& id) { return iter->second; } -std::pair<StringPiece, ApiVersion> GetDevelopmentSdkCodeNameAndVersion() { - return std::make_pair(StringPiece(sDevelopmentSdkCodeName), sDevelopmentSdkLevel); +Maybe<ApiVersion> GetDevelopmentSdkCodeNameVersion(const StringPiece& code_name) { + return (sDevelopmentSdkCodeNames.find(code_name) == sDevelopmentSdkCodeNames.end()) + ? Maybe<ApiVersion>() : sDevelopmentSdkLevel; } } // namespace aapt |