Loading include/input/Input.h +2 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,8 @@ enum class KeyboardType { NONE = AINPUT_KEYBOARD_TYPE_NONE, NON_ALPHABETIC = AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC, ALPHABETIC = AINPUT_KEYBOARD_TYPE_ALPHABETIC, ftl_first = NONE, ftl_last = ALPHABETIC, }; bool isStylusToolType(ToolType toolType); Loading services/inputflinger/reader/include/InputDevice.h +4 −4 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public: inline InputReaderContext* getContext() { return mContext; } inline int32_t getId() const { return mId; } inline int32_t getControllerNumber() const { return mControllerNumber; } inline int32_t getGeneration() const { return mGeneration; } inline virtual int32_t getGeneration() const { return mGeneration; } inline const std::string getName() const { return mIdentifier.name; } inline const std::string getDescriptor() { return mIdentifier.descriptor; } inline std::optional<std::string> getBluetoothAddress() const { Loading @@ -59,7 +59,7 @@ public: inline virtual uint32_t getSources() const { return mSources; } inline bool hasEventHubDevices() const { return !mDevices.empty(); } inline bool isExternal() { return mIsExternal; } inline virtual bool isExternal() { return mIsExternal; } inline std::optional<uint8_t> getAssociatedDisplayPort() const { return mAssociatedDisplayPort; } Loading @@ -79,7 +79,7 @@ public: inline bool isIgnored() { return !getMapperCount() && !mController; } inline KeyboardType getKeyboardType() const { return mKeyboardType; } inline virtual KeyboardType getKeyboardType() const { return mKeyboardType; } bool isEnabled(); Loading Loading @@ -124,7 +124,7 @@ public: int32_t getMetaState(); void setKeyboardType(KeyboardType keyboardType); void bumpGeneration(); virtual void bumpGeneration(); [[nodiscard]] NotifyDeviceResetArgs notifyReset(nsecs_t when); Loading services/inputflinger/tests/InputMapperTest.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -100,9 +100,14 @@ std::list<NotifyArgs> InputMapperUnitTest::process(int32_t type, int32_t code, i std::list<NotifyArgs> InputMapperUnitTest::process(nsecs_t when, int32_t type, int32_t code, int32_t value) { return process(when, when, type, code, value); } std::list<NotifyArgs> InputMapperUnitTest::process(nsecs_t when, nsecs_t readTime, int32_t type, int32_t code, int32_t value) { RawEvent event; event.when = when; event.readTime = when; event.readTime = readTime; event.deviceId = mMapper->getDeviceContext().getEventHubId(); event.type = type; event.code = code; Loading services/inputflinger/tests/InputMapperTest.h +2 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ protected: std::list<NotifyArgs> process(int32_t type, int32_t code, int32_t value); std::list<NotifyArgs> process(nsecs_t when, int32_t type, int32_t code, int32_t value); std::list<NotifyArgs> process(nsecs_t when, nsecs_t readTime, int32_t type, int32_t code, int32_t value); InputDeviceIdentifier mIdentifier; MockEventHubInterface mMockEventHub; Loading services/inputflinger/tests/InterfaceMocks.h +8 −2 Original line number Diff line number Diff line Loading @@ -201,7 +201,9 @@ public: MOCK_METHOD(uint32_t, getSources, (), (const, override)); MOCK_METHOD(std::optional<DisplayViewport>, getAssociatedViewport, (), (const)); MOCK_METHOD(KeyboardType, getKeyboardType, (), (const, override)); MOCK_METHOD(bool, isEnabled, (), ()); MOCK_METHOD(bool, isExternal, (), (override)); MOCK_METHOD(void, dump, (std::string& dump, const std::string& eventHubDevStr), ()); MOCK_METHOD(void, addEmptyEventHubDevice, (int32_t eventHubId), ()); Loading Loading @@ -249,8 +251,6 @@ public: MOCK_METHOD(int32_t, getMetaState, (), ()); MOCK_METHOD(void, setKeyboardType, (KeyboardType keyboardType), ()); MOCK_METHOD(void, bumpGeneration, (), ()); MOCK_METHOD(const PropertyMap&, getConfiguration, (), (const, override)); MOCK_METHOD(NotifyDeviceResetArgs, notifyReset, (nsecs_t when), ()); Loading @@ -260,5 +260,11 @@ public: MOCK_METHOD(void, updateLedState, (bool reset), ()); MOCK_METHOD(size_t, getMapperCount, (), ()); virtual int32_t getGeneration() const override { return mGeneration; } virtual void bumpGeneration() override { mGeneration++; } private: int32_t mGeneration = 0; }; } // namespace android Loading
include/input/Input.h +2 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,8 @@ enum class KeyboardType { NONE = AINPUT_KEYBOARD_TYPE_NONE, NON_ALPHABETIC = AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC, ALPHABETIC = AINPUT_KEYBOARD_TYPE_ALPHABETIC, ftl_first = NONE, ftl_last = ALPHABETIC, }; bool isStylusToolType(ToolType toolType); Loading
services/inputflinger/reader/include/InputDevice.h +4 −4 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public: inline InputReaderContext* getContext() { return mContext; } inline int32_t getId() const { return mId; } inline int32_t getControllerNumber() const { return mControllerNumber; } inline int32_t getGeneration() const { return mGeneration; } inline virtual int32_t getGeneration() const { return mGeneration; } inline const std::string getName() const { return mIdentifier.name; } inline const std::string getDescriptor() { return mIdentifier.descriptor; } inline std::optional<std::string> getBluetoothAddress() const { Loading @@ -59,7 +59,7 @@ public: inline virtual uint32_t getSources() const { return mSources; } inline bool hasEventHubDevices() const { return !mDevices.empty(); } inline bool isExternal() { return mIsExternal; } inline virtual bool isExternal() { return mIsExternal; } inline std::optional<uint8_t> getAssociatedDisplayPort() const { return mAssociatedDisplayPort; } Loading @@ -79,7 +79,7 @@ public: inline bool isIgnored() { return !getMapperCount() && !mController; } inline KeyboardType getKeyboardType() const { return mKeyboardType; } inline virtual KeyboardType getKeyboardType() const { return mKeyboardType; } bool isEnabled(); Loading Loading @@ -124,7 +124,7 @@ public: int32_t getMetaState(); void setKeyboardType(KeyboardType keyboardType); void bumpGeneration(); virtual void bumpGeneration(); [[nodiscard]] NotifyDeviceResetArgs notifyReset(nsecs_t when); Loading
services/inputflinger/tests/InputMapperTest.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -100,9 +100,14 @@ std::list<NotifyArgs> InputMapperUnitTest::process(int32_t type, int32_t code, i std::list<NotifyArgs> InputMapperUnitTest::process(nsecs_t when, int32_t type, int32_t code, int32_t value) { return process(when, when, type, code, value); } std::list<NotifyArgs> InputMapperUnitTest::process(nsecs_t when, nsecs_t readTime, int32_t type, int32_t code, int32_t value) { RawEvent event; event.when = when; event.readTime = when; event.readTime = readTime; event.deviceId = mMapper->getDeviceContext().getEventHubId(); event.type = type; event.code = code; Loading
services/inputflinger/tests/InputMapperTest.h +2 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ protected: std::list<NotifyArgs> process(int32_t type, int32_t code, int32_t value); std::list<NotifyArgs> process(nsecs_t when, int32_t type, int32_t code, int32_t value); std::list<NotifyArgs> process(nsecs_t when, nsecs_t readTime, int32_t type, int32_t code, int32_t value); InputDeviceIdentifier mIdentifier; MockEventHubInterface mMockEventHub; Loading
services/inputflinger/tests/InterfaceMocks.h +8 −2 Original line number Diff line number Diff line Loading @@ -201,7 +201,9 @@ public: MOCK_METHOD(uint32_t, getSources, (), (const, override)); MOCK_METHOD(std::optional<DisplayViewport>, getAssociatedViewport, (), (const)); MOCK_METHOD(KeyboardType, getKeyboardType, (), (const, override)); MOCK_METHOD(bool, isEnabled, (), ()); MOCK_METHOD(bool, isExternal, (), (override)); MOCK_METHOD(void, dump, (std::string& dump, const std::string& eventHubDevStr), ()); MOCK_METHOD(void, addEmptyEventHubDevice, (int32_t eventHubId), ()); Loading Loading @@ -249,8 +251,6 @@ public: MOCK_METHOD(int32_t, getMetaState, (), ()); MOCK_METHOD(void, setKeyboardType, (KeyboardType keyboardType), ()); MOCK_METHOD(void, bumpGeneration, (), ()); MOCK_METHOD(const PropertyMap&, getConfiguration, (), (const, override)); MOCK_METHOD(NotifyDeviceResetArgs, notifyReset, (nsecs_t when), ()); Loading @@ -260,5 +260,11 @@ public: MOCK_METHOD(void, updateLedState, (bool reset), ()); MOCK_METHOD(size_t, getMapperCount, (), ()); virtual int32_t getGeneration() const override { return mGeneration; } virtual void bumpGeneration() override { mGeneration++; } private: int32_t mGeneration = 0; }; } // namespace android