Make parse prop file a util function

This commit is contained in:
topjohnwu
2019-03-05 20:27:09 -05:00
parent b278d07b05
commit 04ef1e6405
8 changed files with 35 additions and 59 deletions
+3 -3
View File
@@ -118,9 +118,9 @@ static void main_daemon() {
// Get API level
parse_prop_file("/system/build.prop", [](auto key, auto val) -> bool {
if (strcmp(key, "ro.build.version.sdk") == 0) {
LOGI("* Device API level: %s\n", val);
SDK_INT = atoi(val);
if (key == "ro.build.version.sdk") {
LOGI("* Device API level: %s\n", val.data());
SDK_INT = atoi(val.data());
return false;
}
return true;