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

Commit 41d3223d authored by Devin Moore's avatar Devin Moore Committed by Gerrit Code Review
Browse files

Merge "Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware"""

parents f326be7c 86ec18bc
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -91,12 +91,6 @@ bool fs_mgr_get_boot_config_from_bootconfig(const std::string& bootconfig,
        if (key == bootconfig_key) {
            *out_val = value;
            return true;
        } else if (android_key == "hardware" && android_key == key) {
            // bootconfig doesn't allow subkeys and values to coexist, so
            // "androidboot.hardware" cannot be used. It is replaced in
            // bootconfig with "hardware"
            *out_val = value;
            return true;
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ const std::string bootconfig =
        "androidboot.serialno = \"BLAHBLAHBLAH\"\n"
        "androidboot.slot_suffix = \"_a\"\n"
        "androidboot.hardware.platform = \"sdw813\"\n"
        "hardware = \"foo\"\n"
        "androidboot.hardware = \"foo\"\n"
        "androidboot.revision = \"EVT1.0\"\n"
        "androidboot.bootloader = \"burp-0.1-7521\"\n"
        "androidboot.hardware.sku = \"mary\"\n"
@@ -159,7 +159,7 @@ const std::vector<std::pair<std::string, std::string>> bootconfig_result_space =
        {"androidboot.serialno", "BLAHBLAHBLAH"},
        {"androidboot.slot_suffix", "_a"},
        {"androidboot.hardware.platform", "sdw813"},
        {"hardware", "foo"},
        {"androidboot.hardware", "foo"},
        {"androidboot.revision", "EVT1.0"},
        {"androidboot.bootloader", "burp-0.1-7521"},
        {"androidboot.hardware.sku", "mary"},
+0 −10
Original line number Diff line number Diff line
@@ -1238,21 +1238,11 @@ static void ProcessKernelCmdline() {
    });
}

// bootconfig does not allow to populate `key=value` simultaneously with
// `key.subkey=value` which does not work with the existing code for
// `hardware` (e.g. we want both `ro.boot.hardware=value` and
// `ro.boot.hardware.sku=value`) and for `qemu` (Android Stidio Emulator
// specific).
static bool IsAllowedBootconfigKey(const std::string_view key) {
    return (key == "hardware"sv) || (key == "qemu"sv);
}

static void ProcessBootconfig() {
    ImportBootconfig([&](const std::string& key, const std::string& value) {
        if (StartsWith(key, ANDROIDBOOT_PREFIX)) {
            InitPropertySet("ro.boot." + key.substr(ANDROIDBOOT_PREFIX.size()), value);
        } else if (IsAllowedBootconfigKey(key)) {
            InitPropertySet("ro.boot." + key, value);
        }
    });
}