summaryrefslogtreecommitdiff
path: root/libs/input/KeyLayoutMap.cpp
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2023-12-05 14:18:19 +0900
committer Jooyung Han <jooyung@google.com> 2023-12-22 10:40:06 +0900
commit3f669216c6c484c559ea9699e67864fddf8c31dc (patch)
tree88345312c154c2f89087ebe81c293f3bf588549c /libs/input/KeyLayoutMap.cpp
parentd3eabb9d62f5968fd71c1cd92fdccb2790a65d14 (diff)
libinput: use libkernelconfigs insteadof libvintf
We'd like to limit the direct usage of libvintf. Bug: 270169217 Test: atest libinput_tests Change-Id: I7630116345e1db736a8173467fc865cea6ec4e96
Diffstat (limited to 'libs/input/KeyLayoutMap.cpp')
-rw-r--r--libs/input/KeyLayoutMap.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/libs/input/KeyLayoutMap.cpp b/libs/input/KeyLayoutMap.cpp
index 3c1ae3e41b..ab8c341b15 100644
--- a/libs/input/KeyLayoutMap.cpp
+++ b/libs/input/KeyLayoutMap.cpp
@@ -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()) {