summaryrefslogtreecommitdiff
path: root/libs/input/KeyLayoutMap.cpp
diff options
context:
space:
mode:
author Hiroki Sato <hirokisato@google.com> 2024-01-17 18:00:58 +0900
committer Hiroki Sato <hirokisato@google.com> 2024-01-18 10:59:52 +0900
commita50396ac3902482580eb59e259de1a6203cfc9e4 (patch)
treeb81d76bfd14f490599b89d8aa2c903df004f43e6 /libs/input/KeyLayoutMap.cpp
parenta57e6352c0dd4e3fee25229eed77cc68fc4c684d (diff)
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
Diffstat (limited to 'libs/input/KeyLayoutMap.cpp')
-rw-r--r--libs/input/KeyLayoutMap.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/input/KeyLayoutMap.cpp b/libs/input/KeyLayoutMap.cpp
index ab8c341b15..508818852e 100644
--- a/libs/input/KeyLayoutMap.cpp
+++ b/libs/input/KeyLayoutMap.cpp
@@ -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");