InputVerifier: Accept invalid utf-8 strings silently
Rust's String seems to have more strict requirements than cpp's
std::string, since its creation will fail if the string is not valid in
its encoding format. rust::String from cxxbridge escalates the error
and causes a panic.
Since we do not perform a validity check on the std::string that comes
from apps, we must use rust::String::lossy() to create the rust::String
for cxxbridge, since it is tolorant of invalid encodings.
Bug: 295014987
Test: atest libinput_tests
Change-Id: I45ecc6117a43cf25ac6ac15fd57ae25e7174d88f
diff --git a/libs/input/tests/Android.bp b/libs/input/tests/Android.bp
index cadac88..86b996b 100644
--- a/libs/input/tests/Android.bp
+++ b/libs/input/tests/Android.bp
@@ -18,6 +18,7 @@
"InputDevice_test.cpp",
"InputEvent_test.cpp",
"InputPublisherAndConsumer_test.cpp",
+ "InputVerifier_test.cpp",
"MotionPredictor_test.cpp",
"RingBuffer_test.cpp",
"TfLiteMotionPredictor_test.cpp",