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

Commit f0ab2c87 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Remove wrongDevice variable

After the last refactor, this variable is no longer used.

Bug: 211379801
Test: atest inputflinger_tests
Change-Id: I3ed706ef806c4f80f27bbbf5cf90460592e7a318
parent 3681e5a1
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -2092,7 +2092,7 @@ std::vector<TouchedWindow> InputDispatcher::findTouchedWindowTargetsLocked(
    }
    }


    bool isSplit = shouldSplitTouch(tempTouchState, entry);
    bool isSplit = shouldSplitTouch(tempTouchState, entry);
    bool switchedDevice = tempTouchState.deviceId >= 0 && tempTouchState.displayId >= 0 &&
    const bool switchedDevice = tempTouchState.deviceId >= 0 && tempTouchState.displayId >= 0 &&
            (tempTouchState.deviceId != entry.deviceId || tempTouchState.source != entry.source ||
            (tempTouchState.deviceId != entry.deviceId || tempTouchState.source != entry.source ||
             tempTouchState.displayId != displayId);
             tempTouchState.displayId != displayId);


@@ -2102,7 +2102,6 @@ std::vector<TouchedWindow> InputDispatcher::findTouchedWindowTargetsLocked(
    const bool newGesture = (maskedAction == AMOTION_EVENT_ACTION_DOWN ||
    const bool newGesture = (maskedAction == AMOTION_EVENT_ACTION_DOWN ||
                             maskedAction == AMOTION_EVENT_ACTION_SCROLL || isHoverAction);
                             maskedAction == AMOTION_EVENT_ACTION_SCROLL || isHoverAction);
    const bool isFromMouse = isFromSource(entry.source, AINPUT_SOURCE_MOUSE);
    const bool isFromMouse = isFromSource(entry.source, AINPUT_SOURCE_MOUSE);
    bool wrongDevice = false;
    if (newGesture) {
    if (newGesture) {
        bool down = maskedAction == AMOTION_EVENT_ACTION_DOWN;
        bool down = maskedAction == AMOTION_EVENT_ACTION_DOWN;
        if (switchedDevice && tempTouchState.down && !down && !isHoverAction) {
        if (switchedDevice && tempTouchState.down && !down && !isHoverAction) {
@@ -2111,9 +2110,7 @@ std::vector<TouchedWindow> InputDispatcher::findTouchedWindowTargetsLocked(
                  displayId);
                  displayId);
            // TODO: test multiple simultaneous input streams.
            // TODO: test multiple simultaneous input streams.
            outInjectionResult = InputEventInjectionResult::FAILED;
            outInjectionResult = InputEventInjectionResult::FAILED;
            switchedDevice = false;
            return touchedWindows; // wrong device
            wrongDevice = true;
            return touchedWindows;
        }
        }
        tempTouchState.reset();
        tempTouchState.reset();
        tempTouchState.down = down;
        tempTouchState.down = down;
@@ -2127,9 +2124,7 @@ std::vector<TouchedWindow> InputDispatcher::findTouchedWindowTargetsLocked(
              displayId);
              displayId);
        // TODO: test multiple simultaneous input streams.
        // TODO: test multiple simultaneous input streams.
        outInjectionResult = InputEventInjectionResult::FAILED;
        outInjectionResult = InputEventInjectionResult::FAILED;
        switchedDevice = false;
        return touchedWindows; // wrong device
        wrongDevice = true;
        return touchedWindows;
    }
    }


    if (newGesture || (isSplit && maskedAction == AMOTION_EVENT_ACTION_POINTER_DOWN)) {
    if (newGesture || (isSplit && maskedAction == AMOTION_EVENT_ACTION_POINTER_DOWN)) {