Loading libs/input/InputVerifier.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ namespace android { // --- InputVerifier --- InputVerifier::InputVerifier(const std::string& name) : mVerifier(android::input::verifier::create(name)){}; : mVerifier(android::input::verifier::create(rust::String::lossy(name))){}; Result<void> InputVerifier::processMovement(int32_t deviceId, int32_t action, uint32_t pointerCount, const PointerProperties* pointerProperties, Loading libs/input/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ cc_test { "InputDevice_test.cpp", "InputEvent_test.cpp", "InputPublisherAndConsumer_test.cpp", "InputVerifier_test.cpp", "MotionPredictor_test.cpp", "RingBuffer_test.cpp", "TfLiteMotionPredictor_test.cpp", Loading libs/input/tests/InputVerifier_test.cpp 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <gtest/gtest.h> #include <input/InputVerifier.h> #include <string> namespace android { TEST(InputVerifierTest, CreationWithInvalidUtfStringDoesNotCrash) { constexpr char bytes[] = {static_cast<char>(0xC0), static_cast<char>(0x80)}; const std::string name(bytes, sizeof(bytes)); InputVerifier verifier(name); } } // namespace android Loading
libs/input/InputVerifier.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ namespace android { // --- InputVerifier --- InputVerifier::InputVerifier(const std::string& name) : mVerifier(android::input::verifier::create(name)){}; : mVerifier(android::input::verifier::create(rust::String::lossy(name))){}; Result<void> InputVerifier::processMovement(int32_t deviceId, int32_t action, uint32_t pointerCount, const PointerProperties* pointerProperties, Loading
libs/input/tests/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ cc_test { "InputDevice_test.cpp", "InputEvent_test.cpp", "InputPublisherAndConsumer_test.cpp", "InputVerifier_test.cpp", "MotionPredictor_test.cpp", "RingBuffer_test.cpp", "TfLiteMotionPredictor_test.cpp", Loading
libs/input/tests/InputVerifier_test.cpp 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <gtest/gtest.h> #include <input/InputVerifier.h> #include <string> namespace android { TEST(InputVerifierTest, CreationWithInvalidUtfStringDoesNotCrash) { constexpr char bytes[] = {static_cast<char>(0xC0), static_cast<char>(0x80)}; const std::string name(bytes, sizeof(bytes)); InputVerifier verifier(name); } } // namespace android