summaryrefslogtreecommitdiffstats
path: root/libs/ui
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
commitdc3e00563ee6400936e3cb82405bb94df0b35078 (patch)
tree45a8f8fa13d5d8164a25a64f1137e279f1d9e59c /libs/ui
parentc7510581b81d63536db7d46ca8533106c8cf57c6 (diff)
downloadframeworks_base-dc3e00563ee6400936e3cb82405bb94df0b35078.zip
frameworks_base-dc3e00563ee6400936e3cb82405bb94df0b35078.tar.gz
frameworks_base-dc3e00563ee6400936e3cb82405bb94df0b35078.tar.bz2
Fix NPE when handling certain kinds of ANRs.
Change-Id: Iccef1852e52c84f6f49d30c491431460a10b33d3
Diffstat (limited to 'libs/ui')
-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();
+ }
}
}
}