summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/inputflinger/dispatcher/InputDispatcher.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 155021d325..1dbcf98652 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2748,7 +2748,10 @@ int InputDispatcher::handleReceiveCallback(int fd, int events, void* data) {
// Monitor channels are never explicitly unregistered.
// We do it automatically when the remote endpoint is closed so don't warn
// about them.
- notify = !connection->monitor;
+ const bool stillHaveWindowHandle =
+ d->getWindowHandleLocked(connection->inputChannel->getConnectionToken()) !=
+ nullptr;
+ notify = !connection->monitor && stillHaveWindowHandle;
if (notify) {
ALOGW("channel '%s' ~ Consumer closed input channel or an error occurred. "
"events=0x%x",