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

Commit 9d386604 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou Committed by Automerger Merge Worker
Browse files

Merge "Cancel only the gesture corresponding to the dropped event" into main...

Merge "Cancel only the gesture corresponding to the dropped event" into main am: e88ab061 am: 91350575 am: d47a3d31

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2890872



Change-Id: I2252e197dc2f3cc8d31b1aa82e021cd01560e9e8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3493398f d47a3d31
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1418,6 +1418,9 @@ void InputDispatcher::dropInboundEventLocked(const EventEntry& entry, DropReason
    switch (entry.type) {
        case EventEntry::Type::KEY: {
            CancelationOptions options(CancelationOptions::Mode::CANCEL_NON_POINTER_EVENTS, reason);
            const KeyEntry& keyEntry = static_cast<const KeyEntry&>(entry);
            options.displayId = keyEntry.displayId;
            options.deviceId = keyEntry.deviceId;
            synthesizeCancelationEventsForAllConnectionsLocked(options);
            break;
        }
@@ -1425,10 +1428,14 @@ void InputDispatcher::dropInboundEventLocked(const EventEntry& entry, DropReason
            const MotionEntry& motionEntry = static_cast<const MotionEntry&>(entry);
            if (motionEntry.source & AINPUT_SOURCE_CLASS_POINTER) {
                CancelationOptions options(CancelationOptions::Mode::CANCEL_POINTER_EVENTS, reason);
                options.displayId = motionEntry.displayId;
                options.deviceId = motionEntry.deviceId;
                synthesizeCancelationEventsForAllConnectionsLocked(options);
            } else {
                CancelationOptions options(CancelationOptions::Mode::CANCEL_NON_POINTER_EVENTS,
                                           reason);
                options.displayId = motionEntry.displayId;
                options.deviceId = motionEntry.deviceId;
                synthesizeCancelationEventsForAllConnectionsLocked(options);
            }
            break;