Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a60b9c4 authored by Ryan Mitchell's avatar Ryan Mitchell Committed by Dan Willemsen
Browse files

master designated for R. Update MAX_PLATFORM_VERSION, etc.

Test: aapt2_tests
Bug: 128934651
Change-Id: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
Merged-In: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
parent ad5b4ba2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -497,9 +497,9 @@ Maybe<int> ParseSdkVersion(const StringPiece& str) {
  }

  // Try parsing the code name.
  std::pair<StringPiece, int> entry = GetDevelopmentSdkCodeNameAndVersion();
  if (entry.first == trimmed_str) {
    return entry.second;
  Maybe<int> entry = GetDevelopmentSdkCodeNameVersion(trimmed_str);
  if (entry) {
    return entry.value();
  }
  return {};
}
+7 −4
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ enum : ApiVersion {
};

ApiVersion FindAttributeSdkLevel(const ResourceId& id);
std::pair<android::StringPiece, ApiVersion> GetDevelopmentSdkCodeNameAndVersion();
Maybe<ApiVersion> GetDevelopmentSdkCodeNameVersion(const android::StringPiece& code_name);

}  // namespace aapt