Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ed32780 authored by Hridya Valsaraju's avatar Hridya Valsaraju
Browse files

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
parent 6590255d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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()) {
    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() {