diff options
author | Hridya Valsaraju <hridya@google.com> | 2018-09-25 15:43:42 -0700 |
---|---|---|
committer | Hridya Valsaraju <hridya@google.com> | 2018-09-25 15:49:59 -0700 |
commit | 5ed32780b4d6f215ad591e6259f7235150b26a63 (patch) | |
tree | d81bacefdc824995805ed3a7f6ccf882bf8ddddd /init/init.cpp | |
parent | 6590255dbbcbd35c527b3a2e6871275ec88fee64 (diff) | |
download | system_core-5ed32780b4d6f215ad591e6259f7235150b26a63.tar.gz system_core-5ed32780b4d6f215ad591e6259f7235150b26a63.tar.bz2 system_core-5ed32780b4d6f215ad591e6259f7235150b26a63.zip |
Set device lock status from kernel command line.
Device is considered to be unlocked if
androidboot.verifiedbootstate is "orange".
Test: adb shell getprop ro.boot.flash.locked
Change-Id: Id3aeec757908ea63a37e28ad880a6c71d53083ac
Diffstat (limited to 'init/init.cpp')
-rw-r--r-- | init/init.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/init/init.cpp b/init/init.cpp index 3ab0a5287..0287e666d 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -344,12 +344,12 @@ static void export_oem_lock_status() { if (!android::base::GetBoolProperty("ro.oem_unlock_supported", false)) { return; } - - std::string value = GetProperty("ro.boot.verifiedbootstate", ""); - - if (!value.empty()) { - property_set("ro.boot.flash.locked", value == "orange" ? "0" : "1"); - } + import_kernel_cmdline( + false, [](const std::string& key, const std::string& value, bool in_qemu) { + if (key == "androidboot.verifiedbootstate") { + property_set("ro.boot.flash.locked", value == "orange" ? "0" : "1"); + } + }); } static void export_kernel_boot_props() { |