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

Commit 9336dd46 authored by Ján Sebechlebský's avatar Ján Sebechlebský Committed by Android (Google) Code Review
Browse files

Merge "Revert "EventHub: Enforce that absolute axis values are within reported range"" into main

parents cec2d8cc f78903ad
Loading
Loading
Loading
Loading
+0 −17
Original line number Original line Diff line number Diff line
@@ -456,16 +456,6 @@ static std::unordered_map<int32_t /*lightId*/, RawLightInfo> readLightsConfigura
    return lightInfos;
    return lightInfos;
}
}


static bool isValidEvAbsValue(int32_t code, int32_t value, const RawAbsoluteAxisInfo& info) {
    if (code == ABS_MT_TRACKING_ID && value == -1) {
        return true;
    }
    if (value >= info.minValue && value <= info.maxValue) {
        return true;
    }
    return false;
}

// --- Global Functions ---
// --- Global Functions ---


ftl::Flags<InputDeviceClass> getAbsAxisUsage(int32_t axis,
ftl::Flags<InputDeviceClass> getAbsAxisUsage(int32_t axis,
@@ -814,13 +804,6 @@ void EventHub::Device::trackInputEvent(const struct input_event& event) {
                                InputEventLookup::getLinuxEvdevLabel(EV_ABS, event.code, 0)
                                InputEventLookup::getLinuxEvdevLabel(EV_ABS, event.code, 0)
                                        .code.c_str(),
                                        .code.c_str(),
                                event.value);
                                event.value);
            LOG_ALWAYS_FATAL_IF(!isValidEvAbsValue(event.code, event.value, it->second.info),
                                "%s: device '%s' received invalid value %d for EV_ABS code %s with "
                                "range [%d, %d]",
                                __func__, identifier.name.c_str(), event.value,
                                InputEventLookup::getLinuxEvdevLabel(EV_ABS, event.code, 0)
                                        .code.c_str(),
                                it->second.info.minValue, it->second.info.maxValue);
            it->second.value = event.value;
            it->second.value = event.value;
            break;
            break;
        }
        }