Loading services/inputflinger/dispatcher/InputDispatcher.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -1461,6 +1461,11 @@ bool InputDispatcher::dispatchDeviceResetLocked(nsecs_t currentTime, CancelationOptions options(CancelationOptions::Mode::CANCEL_ALL_EVENTS, "device was reset"); options.deviceId = entry.deviceId; synthesizeCancelationEventsForAllConnectionsLocked(options); // Remove all active pointers from this device for (auto& [_, touchState] : mTouchStatesByDisplay) { touchState.removeAllPointersForDevice(entry.deviceId); } return true; } Loading services/inputflinger/dispatcher/TouchState.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,18 @@ void TouchState::removeHoveringPointer(int32_t hoveringDeviceId, int32_t hoverin clearWindowsWithoutPointers(); } void TouchState::removeAllPointersForDevice(int32_t removedDeviceId) { for (TouchedWindow& window : windows) { window.removeAllHoveringPointersForDevice(removedDeviceId); } if (deviceId == removedDeviceId) { for (TouchedWindow& window : windows) { window.removeAllTouchingPointers(); } } clearWindowsWithoutPointers(); } std::string TouchState::dump() const { std::string out; out += StringPrintf("deviceId=%d, source=%s\n", deviceId, Loading services/inputflinger/dispatcher/TouchState.h +2 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ struct TouchState { int32_t deviceId, int32_t hoveringPointerId); void removeHoveringPointer(int32_t deviceId, int32_t hoveringPointerId); void clearHoveringPointers(); void removeAllPointersForDevice(int32_t removedDeviceId); void removeWindowByToken(const sp<IBinder>& token); void filterNonAsIsTouchWindows(); Loading services/inputflinger/dispatcher/TouchedWindow.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,10 @@ void TouchedWindow::removeTouchingPointer(int32_t pointerId) { } } void TouchedWindow::removeAllTouchingPointers() { pointerIds.reset(); } void TouchedWindow::removeHoveringPointer(int32_t deviceId, int32_t pointerId) { const auto it = mHoveringPointerIdsByDevice.find(deviceId); if (it == mHoveringPointerIdsByDevice.end()) { Loading @@ -70,6 +74,10 @@ void TouchedWindow::removeHoveringPointer(int32_t deviceId, int32_t pointerId) { } } void TouchedWindow::removeAllHoveringPointersForDevice(int32_t deviceId) { mHoveringPointerIdsByDevice.erase(deviceId); } std::string TouchedWindow::dump() const { std::string out; std::string hoveringPointers = Loading services/inputflinger/dispatcher/TouchedWindow.h +3 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ struct TouchedWindow { void addHoveringPointer(int32_t deviceId, int32_t pointerId); void removeHoveringPointer(int32_t deviceId, int32_t pointerId); void removeTouchingPointer(int32_t pointerId); void removeAllTouchingPointers(); void removeAllHoveringPointersForDevice(int32_t deviceId); void clearHoveringPointers(); std::string dump() const; Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -1461,6 +1461,11 @@ bool InputDispatcher::dispatchDeviceResetLocked(nsecs_t currentTime, CancelationOptions options(CancelationOptions::Mode::CANCEL_ALL_EVENTS, "device was reset"); options.deviceId = entry.deviceId; synthesizeCancelationEventsForAllConnectionsLocked(options); // Remove all active pointers from this device for (auto& [_, touchState] : mTouchStatesByDisplay) { touchState.removeAllPointersForDevice(entry.deviceId); } return true; } Loading
services/inputflinger/dispatcher/TouchState.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,18 @@ void TouchState::removeHoveringPointer(int32_t hoveringDeviceId, int32_t hoverin clearWindowsWithoutPointers(); } void TouchState::removeAllPointersForDevice(int32_t removedDeviceId) { for (TouchedWindow& window : windows) { window.removeAllHoveringPointersForDevice(removedDeviceId); } if (deviceId == removedDeviceId) { for (TouchedWindow& window : windows) { window.removeAllTouchingPointers(); } } clearWindowsWithoutPointers(); } std::string TouchState::dump() const { std::string out; out += StringPrintf("deviceId=%d, source=%s\n", deviceId, Loading
services/inputflinger/dispatcher/TouchState.h +2 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ struct TouchState { int32_t deviceId, int32_t hoveringPointerId); void removeHoveringPointer(int32_t deviceId, int32_t hoveringPointerId); void clearHoveringPointers(); void removeAllPointersForDevice(int32_t removedDeviceId); void removeWindowByToken(const sp<IBinder>& token); void filterNonAsIsTouchWindows(); Loading
services/inputflinger/dispatcher/TouchedWindow.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,10 @@ void TouchedWindow::removeTouchingPointer(int32_t pointerId) { } } void TouchedWindow::removeAllTouchingPointers() { pointerIds.reset(); } void TouchedWindow::removeHoveringPointer(int32_t deviceId, int32_t pointerId) { const auto it = mHoveringPointerIdsByDevice.find(deviceId); if (it == mHoveringPointerIdsByDevice.end()) { Loading @@ -70,6 +74,10 @@ void TouchedWindow::removeHoveringPointer(int32_t deviceId, int32_t pointerId) { } } void TouchedWindow::removeAllHoveringPointersForDevice(int32_t deviceId) { mHoveringPointerIdsByDevice.erase(deviceId); } std::string TouchedWindow::dump() const { std::string out; std::string hoveringPointers = Loading
services/inputflinger/dispatcher/TouchedWindow.h +3 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ struct TouchedWindow { void addHoveringPointer(int32_t deviceId, int32_t pointerId); void removeHoveringPointer(int32_t deviceId, int32_t pointerId); void removeTouchingPointer(int32_t pointerId); void removeAllTouchingPointers(); void removeAllHoveringPointersForDevice(int32_t deviceId); void clearHoveringPointers(); std::string dump() const; Loading