Loading libs/input/InputDevice.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <unistd.h> #include <ctype.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/properties.h> #include <android-base/stringprintf.h> Loading Loading @@ -112,9 +113,13 @@ std::string getInputDeviceConfigurationFilePathByName( pathPrefixes.push_back("/apex/" + apex + "/etc/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/"); if (auto androidRoot = getenv("ANDROID_ROOT"); androidRoot != nullptr) { pathPrefixes.push_back(std::string(androidRoot) + "/usr/"); } else { // To support host-based tests, use the data contained near the executable test binary. pathPrefixes.push_back(base::GetExecutableDirectory() + "/system/usr/"); } for (const auto& prefix : pathPrefixes) { path = prefix; appendInputDeviceConfigurationFileRelativePath(path, name, type); Loading libs/input/tests/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,10 @@ cc_test { ":motion_predictor_model", "data/*", ], device_first_data: [ ":keychars_test_data", ":keylayout_test_data", ], test_options: { unit_test: true, }, Loading libs/input/tests/InputDevice_test.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,6 @@ protected: } void SetUp() override { #if !defined(__ANDROID__) GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device."; #endif loadKeyLayout("Generic"); loadKeyCharacterMap("Generic"); } Loading services/inputflinger/tests/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -134,4 +134,8 @@ cc_test { "device-tests", ], native_coverage: false, device_first_data: [ ":keychars_test_data", ":keylayout_test_data", ], } services/inputflinger/tests/InputDispatcher_test.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -7681,9 +7681,6 @@ TEST_F(InputDispatcherTest, FocusedWindow_PolicyConsumedKeyIgnoresDisableUserAct } TEST_F(InputDispatcherTest, FocusedWindow_DoesNotReceivePolicyFallbackKey) { #if !defined(__ANDROID__) GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device."; #endif InputDeviceInfo testDevice = generateTestDeviceInfo(/*vendorId=*/0, /*productId=*/0, /*deviceId=*/1); std::unique_ptr<KeyCharacterMap> kcm = loadKeyCharacterMap("Generic"); Loading Loading
libs/input/InputDevice.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <unistd.h> #include <ctype.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/properties.h> #include <android-base/stringprintf.h> Loading Loading @@ -112,9 +113,13 @@ std::string getInputDeviceConfigurationFilePathByName( pathPrefixes.push_back("/apex/" + apex + "/etc/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/"); if (auto androidRoot = getenv("ANDROID_ROOT"); androidRoot != nullptr) { pathPrefixes.push_back(std::string(androidRoot) + "/usr/"); } else { // To support host-based tests, use the data contained near the executable test binary. pathPrefixes.push_back(base::GetExecutableDirectory() + "/system/usr/"); } for (const auto& prefix : pathPrefixes) { path = prefix; appendInputDeviceConfigurationFileRelativePath(path, name, type); Loading
libs/input/tests/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,10 @@ cc_test { ":motion_predictor_model", "data/*", ], device_first_data: [ ":keychars_test_data", ":keylayout_test_data", ], test_options: { unit_test: true, }, Loading
libs/input/tests/InputDevice_test.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,6 @@ protected: } void SetUp() override { #if !defined(__ANDROID__) GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device."; #endif loadKeyLayout("Generic"); loadKeyCharacterMap("Generic"); } Loading
services/inputflinger/tests/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -134,4 +134,8 @@ cc_test { "device-tests", ], native_coverage: false, device_first_data: [ ":keychars_test_data", ":keylayout_test_data", ], }
services/inputflinger/tests/InputDispatcher_test.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -7681,9 +7681,6 @@ TEST_F(InputDispatcherTest, FocusedWindow_PolicyConsumedKeyIgnoresDisableUserAct } TEST_F(InputDispatcherTest, FocusedWindow_DoesNotReceivePolicyFallbackKey) { #if !defined(__ANDROID__) GTEST_SKIP() << "b/253299089 Generic files are currently read directly from device."; #endif InputDeviceInfo testDevice = generateTestDeviceInfo(/*vendorId=*/0, /*productId=*/0, /*deviceId=*/1); std::unique_ptr<KeyCharacterMap> kcm = loadKeyCharacterMap("Generic"); Loading