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

Commit e629e273 authored by Jooyung Han's avatar Jooyung Han Committed by Android (Google) Code Review
Browse files

Merge "libinput: use libkernelconfigs insteadof libvintf" into main

parents bc902510 3f669216
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ cc_library {
        "libPlatformProperties",
        "libtinyxml2",
        "libutils",
        "libvintf",
        "libz", // needed by libkernelconfigs
        "server_configurable_flags",
    ],

@@ -239,6 +239,7 @@ cc_library {
        "libgui_window_info_static",
        "libui-types",
        "libtflite_static",
        "libkernelconfigs",
    ],

    whole_static_libs: [
+4 −7
Original line number Diff line number Diff line
@@ -27,8 +27,7 @@
#include <utils/Timers.h>
#include <utils/Tokenizer.h>
#if defined(__ANDROID__)
#include <vintf/RuntimeInfo.h>
#include <vintf/VintfObject.h>
#include <vintf/KernelConfigs.h>
#endif

#include <cstdlib>
@@ -98,12 +97,10 @@ static const std::unordered_map<std::string_view, InputDeviceSensorType> SENSOR_

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);
    LOG_ALWAYS_FATAL_IF(runtimeInfo == nullptr, "Kernel configs could not be fetched");
    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");

    const std::map<std::string, std::string>& kernelConfigs = runtimeInfo->kernelConfigs();
    for (const std::string& requiredConfig : configs) {
        const auto configIt = kernelConfigs.find(requiredConfig);
        if (configIt == kernelConfigs.end()) {
+2 −1
Original line number Diff line number Diff line
@@ -36,8 +36,10 @@ cc_test {
        "libgmock",
        "libgui_window_info_static",
        "libinput",
        "libkernelconfigs",
        "libtflite_static",
        "libui-types",
        "libz", // needed by libkernelconfigs
    ],
    cflags: [
        "-Wall",
@@ -61,7 +63,6 @@ cc_test {
        "libPlatformProperties",
        "libtinyxml2",
        "libutils",
        "libvintf",
        "server_configurable_flags",
    ],
    data: [