Loading services/inputflinger/reader/EventHub.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -1209,6 +1209,15 @@ bool EventHub::hasScanCode(int32_t deviceId, int32_t scanCode) const { return false; } bool EventHub::hasKeyCode(int32_t deviceId, int32_t keyCode) const { std::scoped_lock _l(mLock); Device* device = getDeviceLocked(deviceId); if (device != nullptr) { return device->hasKeycodeLocked(keyCode); } return false; } bool EventHub::hasLed(int32_t deviceId, int32_t led) const { std::scoped_lock _l(mLock); Device* device = getDeviceLocked(deviceId); Loading services/inputflinger/reader/InputDevice.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -559,7 +559,13 @@ int32_t InputDevice::getMetaState() { } void InputDevice::updateMetaState(int32_t keyCode) { for_each_mapper([keyCode](InputMapper& mapper) { mapper.updateMetaState(keyCode); }); first_in_mappers<bool>([keyCode](InputMapper& mapper) { if (sourcesMatchMask(mapper.getSources(), AINPUT_SOURCE_KEYBOARD) && mapper.updateMetaState(keyCode)) { return std::make_optional(true); } return std::optional<bool>(); }); } void InputDevice::bumpGeneration() { Loading services/inputflinger/reader/InputReader.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -555,6 +555,7 @@ void InputReader::toggleCapsLockState(int32_t deviceId) { } if (device->isIgnored()) { ALOGW("Ignoring toggleCapsLock for ignored deviceId %" PRId32 ".", deviceId); return; } Loading services/inputflinger/reader/include/EventHub.h +2 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,7 @@ public: uint8_t* outFlags) const = 0; virtual bool hasScanCode(int32_t deviceId, int32_t scanCode) const = 0; virtual bool hasKeyCode(int32_t deviceId, int32_t keyCode) const = 0; /* LED related functions expect Android LED constants, not scan codes or HID usages */ virtual bool hasLed(int32_t deviceId, int32_t led) const = 0; Loading Loading @@ -489,6 +490,7 @@ public: std::vector<TouchVideoFrame> getVideoFrames(int32_t deviceId) override final; bool hasScanCode(int32_t deviceId, int32_t scanCode) const override final; bool hasKeyCode(int32_t deviceId, int32_t keyCode) const override final; bool hasLed(int32_t deviceId, int32_t led) const override final; void setLedState(int32_t deviceId, int32_t led, bool on) override final; Loading services/inputflinger/reader/include/InputDevice.h +1 −0 Original line number Diff line number Diff line Loading @@ -323,6 +323,7 @@ public: inline bool hasScanCode(int32_t scanCode) const { return mEventHub->hasScanCode(mId, scanCode); } inline bool hasKeyCode(int32_t keyCode) const { return mEventHub->hasKeyCode(mId, keyCode); } inline bool hasLed(int32_t led) const { return mEventHub->hasLed(mId, led); } inline void setLedState(int32_t led, bool on) { return mEventHub->setLedState(mId, led, on); } inline void getVirtualKeyDefinitions(std::vector<VirtualKeyDefinition>& outVirtualKeys) const { Loading Loading
services/inputflinger/reader/EventHub.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -1209,6 +1209,15 @@ bool EventHub::hasScanCode(int32_t deviceId, int32_t scanCode) const { return false; } bool EventHub::hasKeyCode(int32_t deviceId, int32_t keyCode) const { std::scoped_lock _l(mLock); Device* device = getDeviceLocked(deviceId); if (device != nullptr) { return device->hasKeycodeLocked(keyCode); } return false; } bool EventHub::hasLed(int32_t deviceId, int32_t led) const { std::scoped_lock _l(mLock); Device* device = getDeviceLocked(deviceId); Loading
services/inputflinger/reader/InputDevice.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -559,7 +559,13 @@ int32_t InputDevice::getMetaState() { } void InputDevice::updateMetaState(int32_t keyCode) { for_each_mapper([keyCode](InputMapper& mapper) { mapper.updateMetaState(keyCode); }); first_in_mappers<bool>([keyCode](InputMapper& mapper) { if (sourcesMatchMask(mapper.getSources(), AINPUT_SOURCE_KEYBOARD) && mapper.updateMetaState(keyCode)) { return std::make_optional(true); } return std::optional<bool>(); }); } void InputDevice::bumpGeneration() { Loading
services/inputflinger/reader/InputReader.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -555,6 +555,7 @@ void InputReader::toggleCapsLockState(int32_t deviceId) { } if (device->isIgnored()) { ALOGW("Ignoring toggleCapsLock for ignored deviceId %" PRId32 ".", deviceId); return; } Loading
services/inputflinger/reader/include/EventHub.h +2 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,7 @@ public: uint8_t* outFlags) const = 0; virtual bool hasScanCode(int32_t deviceId, int32_t scanCode) const = 0; virtual bool hasKeyCode(int32_t deviceId, int32_t keyCode) const = 0; /* LED related functions expect Android LED constants, not scan codes or HID usages */ virtual bool hasLed(int32_t deviceId, int32_t led) const = 0; Loading Loading @@ -489,6 +490,7 @@ public: std::vector<TouchVideoFrame> getVideoFrames(int32_t deviceId) override final; bool hasScanCode(int32_t deviceId, int32_t scanCode) const override final; bool hasKeyCode(int32_t deviceId, int32_t keyCode) const override final; bool hasLed(int32_t deviceId, int32_t led) const override final; void setLedState(int32_t deviceId, int32_t led, bool on) override final; Loading
services/inputflinger/reader/include/InputDevice.h +1 −0 Original line number Diff line number Diff line Loading @@ -323,6 +323,7 @@ public: inline bool hasScanCode(int32_t scanCode) const { return mEventHub->hasScanCode(mId, scanCode); } inline bool hasKeyCode(int32_t keyCode) const { return mEventHub->hasKeyCode(mId, keyCode); } inline bool hasLed(int32_t led) const { return mEventHub->hasLed(mId, led); } inline void setLedState(int32_t led, bool on) { return mEventHub->setLedState(mId, led, on); } inline void getVirtualKeyDefinitions(std::vector<VirtualKeyDefinition>& outVirtualKeys) const { Loading