diff options
| author | 2015-06-29 17:40:25 +0000 | |
|---|---|---|
| committer | 2015-06-29 17:40:25 +0000 | |
| commit | fd0fdaf73b1e8fbf643152f532f500be70f11a26 (patch) | |
| tree | f6484cedd3f1deb5da133073614e33127cc36517 /services/inputflinger/InputDispatcher.cpp | |
| parent | c28e8663dd4a14a7af7bd6a59cc0b490e31c778a (diff) | |
| parent | 3643c88f7b557e241d65c4857eaf49e28e7c03a2 (diff) | |
am 3643c88f: Merge "Send cancelation events to monitors when injection fails." into mnc-dev
* commit '3643c88f7b557e241d65c4857eaf49e28e7c03a2':
Send cancelation events to monitors when injection fails.
Diffstat (limited to 'services/inputflinger/InputDispatcher.cpp')
| -rw-r--r-- | services/inputflinger/InputDispatcher.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index ffaa7e72fb..0fba1bf3e4 100644 --- a/services/inputflinger/InputDispatcher.cpp +++ b/services/inputflinger/InputDispatcher.cpp @@ -859,6 +859,13 @@ bool InputDispatcher::dispatchMotionLocked( setInjectionResultLocked(entry, injectionResult); if (injectionResult != INPUT_EVENT_INJECTION_SUCCEEDED) { + if (injectionResult != INPUT_EVENT_INJECTION_PERMISSION_DENIED) { + CancelationOptions::Mode mode(isPointerEvent ? + CancelationOptions::CANCEL_POINTER_EVENTS : + CancelationOptions::CANCEL_NON_POINTER_EVENTS); + CancelationOptions options(mode, "input event injection failed"); + synthesizeCancelationEventsForMonitorsLocked(options); + } return true; } @@ -886,7 +893,7 @@ void InputDispatcher::logOutboundMotionDetailsLocked(const char* prefix, const M "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%lld", prefix, entry->eventTime, entry->deviceId, entry->source, entry->policyFlags, - entry->action, entry->actionButton entry->flags, + entry->action, entry->actionButton, entry->flags, entry->metaState, entry->buttonState, entry->edgeFlags, entry->xPrecision, entry->yPrecision, entry->downTime); @@ -2167,6 +2174,13 @@ void InputDispatcher::synthesizeCancelationEventsForAllConnectionsLocked( } } +void InputDispatcher::synthesizeCancelationEventsForMonitorsLocked( + const CancelationOptions& options) { + for (size_t i = 0; i < mMonitoringChannels.size(); i++) { + synthesizeCancelationEventsForInputChannelLocked(mMonitoringChannels[i], options); + } +} + void InputDispatcher::synthesizeCancelationEventsForInputChannelLocked( const sp<InputChannel>& channel, const CancelationOptions& options) { ssize_t index = getConnectionIndexLocked(channel); |