From 8fc145fa0c9f677db178e1ab7bb19aa926367816 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Wed, 17 Aug 2022 16:07:40 -0700 Subject: 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 --- libs/input/KeyLayoutMap.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/input/KeyLayoutMap.cpp') diff --git a/libs/input/KeyLayoutMap.cpp b/libs/input/KeyLayoutMap.cpp index 59cc7d1dcd..d6b4579a94 100644 --- a/libs/input/KeyLayoutMap.cpp +++ b/libs/input/KeyLayoutMap.cpp @@ -25,8 +25,10 @@ #include #include #include +#if defined(__ANDROID__) #include #include +#endif #include #include @@ -79,6 +81,7 @@ static const std::unordered_map SENSOR_ sensorPair()}; bool kernelConfigsArePresent(const std::set& configs) { +#if defined(__ANDROID__) std::shared_ptr runtimeInfo = android::vintf::VintfObject::GetInstance()->getRuntimeInfo( vintf::RuntimeInfo::FetchFlag::CONFIG_GZ); @@ -99,6 +102,10 @@ bool kernelConfigsArePresent(const std::set& configs) { } } return true; +#else + (void)configs; // Suppress 'unused variable' warning + return true; +#endif } } // namespace -- cgit v1.2.3-59-g8ed1b