convertFromApiLevel: move to utils.h.
Test: pass
Bug: 70628538
Change-Id: I611ab4ecab1c33496db9ed72a0d13b5c6b34cabf
diff --git a/AssembleVintf.cpp b/AssembleVintf.cpp
index a3f2838..638022f 100644
--- a/AssembleVintf.cpp
+++ b/AssembleVintf.cpp
@@ -151,18 +151,6 @@
return ::android::base::Basename(path) == gBaseConfig;
}
- static Level convertFromApiLevel(size_t apiLevel) {
- if (apiLevel < 26) {
- return Level::LEGACY;
- } else if (apiLevel == 26) {
- return Level::O;
- } else if (apiLevel == 27) {
- return Level::O_MR1;
- } else {
- return Level::UNSPECIFIED;
- }
- }
-
// nullptr on any error, otherwise the condition.
static Condition generateCondition(const std::string& path) {
std::string fname = ::android::base::Basename(path);
@@ -367,7 +355,7 @@
if (shippingApiLevel) {
std::cerr << "Warning: Shipping FCM Version is inferred from Shipping API level. "
<< "Declare Shipping FCM Version in device manifest directly." << std::endl;
- manifest->mLevel = convertFromApiLevel(shippingApiLevel);
+ manifest->mLevel = details::convertFromApiLevel(shippingApiLevel);
if (manifest->mLevel == Level::UNSPECIFIED) {
std::cerr << "Error: Shipping FCM Version cannot be inferred from Shipping API "
<< "level " << shippingApiLevel << "."