staticvoid SetPropertyAndLog(const std::string& key, const std::string& value, const std::string& message = "") { if (android::base::SetProperty(key, value)) {
LOG(INFO) << "Set property " << key << " to " << value << " " << message;
} else {
LOG(ERROR) << "Failed to set property " << key << " to " << value << " " << message;
}
}
// Copies the value of one system property to another if it isn't empty and // passes the predicate test_fn. staticvoid CopyPropertyIf(constchar* src, constchar* dst, bool (*test_fn)(const std::string&)) {
std::string prop = android::base::GetProperty(src, ""); if (prop.empty()) {
LOG(INFO) << "Property " << src << " not set";
} elseif (!test_fn(prop)) {
LOG(INFO) << "Property " << src << " has ignored value " << prop;
} else {
SetPropertyAndLog(dst, prop, std::string("from ") + src);
}
}
int main(int, char** argv) {
android::base::InitLogging(argv);
// Copy properties that must only be set at boot and not change value later. // Note that P/H can change the properties in the experiment namespaces at any // time.
CopyPropertyIf("persist.device_config.runtime_native_boot.useartservice", "dalvik.vm.useartservice", // If an OEM has set dalvik.vm.useartservice to false we // shouldn't override it to true from the P/H property.
[](const std::string& prop) { return prop == "false"; });
return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.