summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-09-16 11:02:16 -0700
committerJeff Brown <jeffbrown@google.com>2010-09-16 11:02:16 -0700
commit40ad4706434b40fa466b23c6e9f03f6dcc32c0c4 (patch)
tree394aead665bd535f75286bcb9b87940bbabade56 /libs
parent30aeb8c8547efbb1fb6c62f35df45842716a7c6d (diff)
downloadframeworks_native-40ad4706434b40fa466b23c6e9f03f6dcc32c0c4.zip
frameworks_native-40ad4706434b40fa466b23c6e9f03f6dcc32c0c4.tar.gz
frameworks_native-40ad4706434b40fa466b23c6e9f03f6dcc32c0c4.tar.bz2
Fix NPE when handling certain kinds of ANRs.
Change-Id: Iccef1852e52c84f6f49d30c491431460a10b33d3
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/InputDispatcher.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index 3b3c483..dea7936 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -777,10 +777,12 @@ void InputDispatcher::resumeAfterTargetsNotReadyTimeoutLocked(nsecs_t newTimeout
mInputTargetWaitTimeoutExpired = true;
// Input state will not be realistic. Mark it out of sync.
- ssize_t connectionIndex = getConnectionIndexLocked(inputChannel);
- if (connectionIndex >= 0) {
- sp<Connection> connection = mConnectionsByReceiveFd.valueAt(connectionIndex);
- connection->inputState.setOutOfSync();
+ if (inputChannel.get()) {
+ ssize_t connectionIndex = getConnectionIndexLocked(inputChannel);
+ if (connectionIndex >= 0) {
+ sp<Connection> connection = mConnectionsByReceiveFd.valueAt(connectionIndex);
+ connection->inputState.setOutOfSync();
+ }
}
}
}