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

Commit ccc15c5d authored by Roman Kiryanov's avatar Roman Kiryanov
Browse files

Move the `androidboot.` literal into its own variable



Bug: 182291166
Test: presubmit
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
Change-Id: I19f25671c82fff34dd52e3557361c4340706aab0
parent 394a1ede
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@
#include <mutex>
#include <mutex>
#include <optional>
#include <optional>
#include <queue>
#include <queue>
#include <string_view>
#include <thread>
#include <thread>
#include <vector>
#include <vector>


@@ -1162,13 +1163,15 @@ static void ProcessKernelDt() {
    }
    }
}
}


constexpr auto ANDROIDBOOT_PREFIX = "androidboot."sv;

static void ProcessKernelCmdline() {
static void ProcessKernelCmdline() {
    bool for_emulator = false;
    bool for_emulator = false;
    ImportKernelCmdline([&](const std::string& key, const std::string& value) {
    ImportKernelCmdline([&](const std::string& key, const std::string& value) {
        if (key == "qemu") {
        if (key == "qemu") {
            for_emulator = true;
            for_emulator = true;
        } else if (StartsWith(key, "androidboot.")) {
        } else if (StartsWith(key, ANDROIDBOOT_PREFIX)) {
            InitPropertySet("ro.boot." + key.substr(12), value);
            InitPropertySet("ro.boot." + key.substr(ANDROIDBOOT_PREFIX.size()), value);
        }
        }
    });
    });


@@ -1182,8 +1185,8 @@ static void ProcessKernelCmdline() {


static void ProcessBootconfig() {
static void ProcessBootconfig() {
    ImportBootconfig([&](const std::string& key, const std::string& value) {
    ImportBootconfig([&](const std::string& key, const std::string& value) {
        if (StartsWith(key, "androidboot.")) {
        if (StartsWith(key, ANDROIDBOOT_PREFIX)) {
            InitPropertySet("ro.boot." + key.substr(12), value);
            InitPropertySet("ro.boot." + key.substr(ANDROIDBOOT_PREFIX.size()), value);
        } else if (key == "hardware") {
        } else if (key == "hardware") {
            // "hardware" in bootconfig replaces "androidboot.hardware" kernel
            // "hardware" in bootconfig replaces "androidboot.hardware" kernel
            // cmdline parameter
            // cmdline parameter