Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 521e071a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "inputflinger: Check for KeyCharacterMap before use" into main

parents 12fb1d2c 8cb62fe8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -662,8 +662,12 @@ bool EventHub::Device::hasKeycodeLocked(int keycode) const {
    if (hasKeycodeInternalLocked(keycode)) {
        return true;
    }

    for (auto& fromKey : getKeyCharacterMap()->findKeyCodesMappedToKeyCode(keycode)) {
    // Check the key character map first. Not all input devices will have one.
    const std::shared_ptr<KeyCharacterMap> kcm = getKeyCharacterMap();
    if (kcm == nullptr) {
        return false;
    }
    for (auto& fromKey : kcm->findKeyCodesMappedToKeyCode(keycode)) {
        if (hasKeycodeInternalLocked(fromKey)) {
            return true;
        }