在Android L NDK中替换`__system_property_get`

asc*_*ied 5 android-ndk-r5

自Android L NDK起__system_property_get删除(https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/keQP6L9aVyU).Android L NDK中是否有另一个API可以访问相同的属性值?

asc*_*ied 6

我去popen如在回答详细/sf/answers/33527231/运行getprop.就像是

std::string command = "getprop ro.product.model";
FILE* file = popen(command.c_str(), "r");
if (!file) {
    // error
}
// read the property value from file
pclose(file);
Run Code Online (Sandbox Code Playgroud)