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

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

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

This reverts commit 568dbe78.

Reason for revert: See https://b.corp.google.com/issues/293156873#comment13

Change-Id: I8011b81b7c29fcf1fcdd67ee4a887a992a3a3c0c
parent 568dbe78
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -456,16 +456,6 @@ static std::unordered_map<int32_t /*lightId*/, RawLightInfo> readLightsConfigura
    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 ---

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)
                                        .code.c_str(),
                                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;
            break;
        }