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

Commit 489359cb authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Delete TouchState::source

It's not clear why we have this behaviour. It's currently untested, and
we don't expect the incoming sources to change, either from the
listener, or from the injection. If the sources change, then it should
be the incoming stream that's responsible for canceling the old gesture,
not the dispatcher.

Bug: 211379801
Test: m inputflinger_tests && $ANDROID_HOST_OUT/nativetest64/inputflinger_tests/inputflinger_tests
Change-Id: I5035a470581af9c161b2c7210e8d65823b719598
parent 45504fe9
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -2257,7 +2257,6 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
        const bool anotherDeviceIsActive =
                oldActiveDevices.count(entry.deviceId) == 0 && !oldActiveDevices.empty();
        switchedDevice |= anotherDeviceIsActive;
        switchedDevice |= oldState->source != entry.source;
    }

    const bool isHoverAction = (maskedAction == AMOTION_EVENT_ACTION_HOVER_MOVE ||
@@ -2287,7 +2286,6 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
    if (newGesture) {
        // If a new gesture is starting, clear the touch state completely.
        tempTouchState.reset();
        tempTouchState.source = entry.source;
        isSplit = false;
    } else if (switchedDevice && maskedAction == AMOTION_EVENT_ACTION_MOVE) {
        ALOGI("Dropping move event because a pointer for a different device is already active "
@@ -2694,7 +2692,6 @@ std::vector<InputTarget> InputDispatcher::findTouchedWindowTargetsLocked(
        }
        if (maskedAction == AMOTION_EVENT_ACTION_HOVER_ENTER ||
            maskedAction == AMOTION_EVENT_ACTION_HOVER_MOVE) {
            tempTouchState.source = entry.source;
        }
    } else if (maskedAction == AMOTION_EVENT_ACTION_UP) {
        // Pointer went up.
+0 −1
Original line number Diff line number Diff line
@@ -277,7 +277,6 @@ void TouchState::removeAllPointersForDevice(int32_t removedDeviceId) {

std::string TouchState::dump() const {
    std::string out;
    out += StringPrintf("source=%s\n", inputEventSourceToString(source).c_str());
    if (!windows.empty()) {
        out += "  Windows:\n";
        for (size_t i = 0; i < windows.size(); i++) {
+0 −3
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@ class WindowInfoHandle;
namespace inputdispatcher {

struct TouchState {
    // source of the device that is current down, others are rejected
    uint32_t source = 0;

    std::vector<TouchedWindow> windows;

    TouchState() = default;