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

Commit d0a16c20 authored by Oleg Matcovschi's avatar Oleg Matcovschi
Browse files

fastboot: derive device locked state from Android property



We shall rely on Android property instead of parsing kernel
command line directly: parameters could be originated from
kernel command line or bootconfig.

Bug: 183237066
Bug: 183719613
Signed-off-by: default avatarOleg Matcovschi <omatcovschi@google.com>
Change-Id: Ia70d286646a83a95967ca4293168a6550ffff7f0
parent 4e94784b
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -204,12 +204,7 @@ std::vector<std::string> ListPartitions(FastbootDevice* device) {
}

bool GetDeviceLockStatus() {
    std::string cmdline;
    // Return lock status true if unable to read kernel command line.
    if (!android::base::ReadFileToString("/proc/cmdline", &cmdline)) {
        return true;
    }
    return cmdline.find("androidboot.verifiedbootstate=orange") == std::string::npos;
    return android::base::GetProperty("ro.boot.verifiedbootstate", "") != "orange";
}

bool UpdateAllPartitionMetadata(FastbootDevice* device, const std::string& super_name,