summaryrefslogtreecommitdiff
path: root/odrefresh/odr_common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'odrefresh/odr_common.cc')
-rw-r--r--odrefresh/odr_common.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/odrefresh/odr_common.cc b/odrefresh/odr_common.cc
index 8f4e263f4c..c3c410e71b 100644
--- a/odrefresh/odr_common.cc
+++ b/odrefresh/odr_common.cc
@@ -21,6 +21,9 @@
#include <string>
#include <string_view>
+#include "android-base/logging.h"
+#include "android-base/parseint.h"
+
namespace art {
namespace odrefresh {
@@ -36,5 +39,14 @@ std::string QuotePath(std::string_view path) {
return Concatenate({"'", path, "'"});
}
+bool ShouldDisableRefresh(const std::string& sdk_version_str) {
+ int sdk_version = 0;
+ if (!android::base::ParseInt(sdk_version_str, &sdk_version)) {
+ LOG(ERROR) << "Invalid SDK version string \"" << sdk_version_str << "\"";
+ return false;
+ }
+ return sdk_version >= 32;
+}
+
} // namespace odrefresh
} // namespace art