diff options
author | Michael Wright <michaelwr@google.com> | 2015-06-29 17:10:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-29 17:10:46 +0000 |
commit | 3643c88f7b557e241d65c4857eaf49e28e7c03a2 (patch) | |
tree | f54d5efe11b80abbb2f0b3810b562da4ea6b4e49 /services/inputflinger | |
parent | f413de05cfb9a1b84b73c8e6c306d4142130c5f7 (diff) | |
parent | fa13dcf39f09534ab8e95aec6f15a61a7f500b4c (diff) | |
download | frameworks_native-3643c88f7b557e241d65c4857eaf49e28e7c03a2.tar.gz frameworks_native-3643c88f7b557e241d65c4857eaf49e28e7c03a2.tar.bz2 frameworks_native-3643c88f7b557e241d65c4857eaf49e28e7c03a2.zip |
Merge "Send cancelation events to monitors when injection fails." into mnc-dev
Diffstat (limited to 'services/inputflinger')
-rw-r--r-- | services/inputflinger/InputDispatcher.cpp | 16 | ||||
-rw-r--r-- | services/inputflinger/InputDispatcher.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index ffaa7e72f..0fba1bf3e 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); diff --git a/services/inputflinger/InputDispatcher.h b/services/inputflinger/InputDispatcher.h index 80eed56c1..98355c6bd 100644 --- a/services/inputflinger/InputDispatcher.h +++ b/services/inputflinger/InputDispatcher.h @@ -1076,6 +1076,7 @@ private: void synthesizeCancelationEventsForAllConnectionsLocked( const CancelationOptions& options); + void synthesizeCancelationEventsForMonitorsLocked(const CancelationOptions& options); void synthesizeCancelationEventsForInputChannelLocked(const sp<InputChannel>& channel, const CancelationOptions& options); void synthesizeCancelationEventsForConnectionLocked(const sp<Connection>& connection, |