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

Commit a50396ac authored by Hiroki Sato's avatar Hiroki Sato
Browse files

Skip loading kernel configs unless needed

Loading kernel configs is needed when the specified layout has
"requires_kernel_config".
Otherwise, we don't need to load kernel configs.

Bug: 320198280
Test: presubmit
Change-Id: I7955d65d804ed4965235a1649c5f5f53996f4d3b
parent a57e6352
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@ static const std::unordered_map<std::string_view, InputDeviceSensorType> SENSOR_

bool kernelConfigsArePresent(const std::set<std::string>& configs) {
#if defined(__ANDROID__)
    if (configs.empty()) {
        return true;
    }

    std::map<std::string, std::string> kernelConfigs;
    const status_t result = android::kernelconfigs::LoadKernelConfigs(&kernelConfigs);
    LOG_ALWAYS_FATAL_IF(result != OK, "Kernel configs could not be fetched");