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

Commit 7f08644b authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Fix atoi build errors

Use strtol instead of atoi to check vendor partition version.

Bug: 119390857
Test: manual
Change-Id: I49c5963d8bbc5a803b3ccc0dd41d7bd7f2a42226
parent 56db15b8
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,10 @@ struct InputOverlay {


bool VendorIsQOrLater() {
bool VendorIsQOrLater() {
  constexpr int kQSdkVersion = 29;
  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.
  // If the string cannot be parsed, it is a development sdk codename.
  return version >= kQSdkVersion || version == 0;
  return version >= kQSdkVersion || version == 0;
}
}