Loading libs/input/InputDevice.cpp +17 −14 Original line number Diff line number Diff line Loading @@ -20,12 +20,14 @@ #include <unistd.h> #include <ctype.h> #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <ftl/enum.h> #include <gui/constants.h> #include <input/InputDevice.h> #include <input/InputEventLabels.h> using android::base::GetProperty; using android::base::StringPrintf; namespace android { Loading Loading @@ -96,21 +98,22 @@ std::string getInputDeviceConfigurationFilePathByName( // Treblized input device config files will be located /product/usr, /system_ext/usr, // /odm/usr or /vendor/usr. // These files may also be in the com.android.input.config APEX. const char* rootsForPartition[]{ "/product", "/system_ext", "/odm", "/vendor", "/apex/com.android.input.config/etc", getenv("ANDROID_ROOT"), std::vector<std::string> pathPrefixes{ "/product/usr/", "/system_ext/usr/", "/odm/usr/", "/vendor/usr/", }; for (size_t i = 0; i < size(rootsForPartition); i++) { if (rootsForPartition[i] == nullptr) { continue; // These files may also be in the APEX pointed by input_device.config_file.apex sysprop. if (auto apex = GetProperty("input_device.config_file.apex", ""); !apex.empty()) { pathPrefixes.push_back("/apex/" + apex + "/etc/usr/"); } path = rootsForPartition[i]; path += "/usr/"; // ANDROID_ROOT may not be set on host if (auto android_root = getenv("ANDROID_ROOT"); android_root != nullptr) { pathPrefixes.push_back(std::string(android_root) + "/usr/"); } for (const auto& prefix : pathPrefixes) { path = prefix; appendInputDeviceConfigurationFileRelativePath(path, name, type); #if DEBUG_PROBE ALOGD("Probing for system provided input device configuration file: path='%s'", Loading Loading
libs/input/InputDevice.cpp +17 −14 Original line number Diff line number Diff line Loading @@ -20,12 +20,14 @@ #include <unistd.h> #include <ctype.h> #include <android-base/properties.h> #include <android-base/stringprintf.h> #include <ftl/enum.h> #include <gui/constants.h> #include <input/InputDevice.h> #include <input/InputEventLabels.h> using android::base::GetProperty; using android::base::StringPrintf; namespace android { Loading Loading @@ -96,21 +98,22 @@ std::string getInputDeviceConfigurationFilePathByName( // Treblized input device config files will be located /product/usr, /system_ext/usr, // /odm/usr or /vendor/usr. // These files may also be in the com.android.input.config APEX. const char* rootsForPartition[]{ "/product", "/system_ext", "/odm", "/vendor", "/apex/com.android.input.config/etc", getenv("ANDROID_ROOT"), std::vector<std::string> pathPrefixes{ "/product/usr/", "/system_ext/usr/", "/odm/usr/", "/vendor/usr/", }; for (size_t i = 0; i < size(rootsForPartition); i++) { if (rootsForPartition[i] == nullptr) { continue; // These files may also be in the APEX pointed by input_device.config_file.apex sysprop. if (auto apex = GetProperty("input_device.config_file.apex", ""); !apex.empty()) { pathPrefixes.push_back("/apex/" + apex + "/etc/usr/"); } path = rootsForPartition[i]; path += "/usr/"; // ANDROID_ROOT may not be set on host if (auto android_root = getenv("ANDROID_ROOT"); android_root != nullptr) { pathPrefixes.push_back(std::string(android_root) + "/usr/"); } for (const auto& prefix : pathPrefixes) { path = prefix; appendInputDeviceConfigurationFileRelativePath(path, name, type); #if DEBUG_PROBE ALOGD("Probing for system provided input device configuration file: path='%s'", Loading