Merge "init: set ro.boot.flash.locked from ro.boot.verifiedbootstate" am: 85abb0860e
am: 226914be6a
* commit '226914be6ad06f1ccbdcd2ea584e748a02665e2d':
init: set ro.boot.flash.locked from ro.boot.verifiedbootstate
diff --git a/init/init.cpp b/init/init.cpp
index 9f4f625..4aef823 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -350,6 +350,18 @@
}
}
+static void export_oem_lock_status() {
+ if (property_get("ro.oem_unlock_supported") != "1") {
+ return;
+ }
+
+ std::string value = property_get("ro.boot.verifiedbootstate");
+
+ if (!value.empty()) {
+ property_set("ro.boot.flash.locked", value == "orange" ? "0" : "1");
+ }
+}
+
static void export_kernel_boot_props() {
struct {
const char *src_prop;
@@ -614,6 +626,7 @@
signal_handler_init();
property_load_boot_defaults();
+ export_oem_lock_status();
start_property_service();
const BuiltinFunctionMap function_map;