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

Commit 8fc145fa authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Do not read kernel configs on the host

When the code runs on host (so that it can validate the key layout
maps), it currently will attempt to read the kernel configs on the host.
What we actually want is to either read the kernel configs on the
device, or to always assume that the config exists.

In this CL, we simply assume that the config exists. Since we are
calling this tool for all key layouts, it should not affect the
validation.

Test: m out/target/common/obj/ETC/validate_framework_keymaps_intermediates/stamp
Bug: 237835584
Change-Id: I79158a7591fa4d8ff0a33dcae9df2b138ae33485
parent 8ef72b10
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -25,8 +25,10 @@
#include <utils/Errors.h>
#include <utils/Timers.h>
#include <utils/Tokenizer.h>
#if defined(__ANDROID__)
#include <vintf/RuntimeInfo.h>
#include <vintf/VintfObject.h>
#endif

#include <cstdlib>
#include <string_view>
@@ -79,6 +81,7 @@ static const std::unordered_map<std::string_view, InputDeviceSensorType> SENSOR_
         sensorPair<InputDeviceSensorType::SIGNIFICANT_MOTION>()};

bool kernelConfigsArePresent(const std::set<std::string>& configs) {
#if defined(__ANDROID__)
    std::shared_ptr<const android::vintf::RuntimeInfo> runtimeInfo =
            android::vintf::VintfObject::GetInstance()->getRuntimeInfo(
                    vintf::RuntimeInfo::FetchFlag::CONFIG_GZ);
@@ -99,6 +102,10 @@ bool kernelConfigsArePresent(const std::set<std::string>& configs) {
        }
    }
    return true;
#else
    (void)configs; // Suppress 'unused variable' warning
    return true;
#endif
}

} // namespace