Fix atoi build errors

Use strtol instead of atoi to check vendor partition version.

Bug: 119390857
Test: manual
Change-Id: I49c5963d8bbc5a803b3ccc0dd41d7bd7f2a42226
This commit is contained in:
Ryan Mitchell
2019-06-03 23:01:34 -07:00
parent 56db15b843
commit 7f08644bd7

View File

@@ -69,7 +69,10 @@ struct InputOverlay {
bool VendorIsQOrLater() {
constexpr int kQSdkVersion = 29;
int version = std::atoi(android::base::GetProperty("ro.vndk.version", "29").data());
constexpr int kBase = 10;
std::string version_prop = android::base::GetProperty("ro.vndk.version", "29");
int version = strtol(version_prop.data(), nullptr, kBase);
// If the string cannot be parsed, it is a development sdk codename.
return version >= kQSdkVersion || version == 0;
}