Differentiate Uinput devices by productId for testing
Unless we somehow differentiate test Uinput devices, if more than one of
those devices are created, they will be merged together into one
InputDevice in InputReader.
Therefore we use a different productId for each Uinput device class.
Bug: 246394583
Test: atest inputflinger_tests
Change-Id: I5669af54d8457cd572fa5bfbff670e7926237fa4
diff --git a/services/inputflinger/tests/InputReader_test.cpp b/services/inputflinger/tests/InputReader_test.cpp
index 04382ee..10acdd2 100644
--- a/services/inputflinger/tests/InputReader_test.cpp
+++ b/services/inputflinger/tests/InputReader_test.cpp
@@ -2373,7 +2373,7 @@
// An invalid input device that is only used for this test.
class InvalidUinputDevice : public UinputDevice {
public:
- InvalidUinputDevice() : UinputDevice("Invalid Device") {}
+ InvalidUinputDevice() : UinputDevice("Invalid Device", 99 /*productId*/) {}
private:
void configureDevice(int fd, uinput_user_dev* device) override {}