summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2010-09-16 11:08:46 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2010-09-16 11:08:46 -0700
commit28de6a0ab682fb51b95e954fc9ee8cb304465421 (patch)
tree5ae8dabac40a6749a21bcb79a56ecc6c2e3a99b0
parent3fe1120aac99626a5e40848739a4569fe2a10444 (diff)
parent4fe5434b2d12888e12585f9a7286d3634ead22f0 (diff)
am 567c00a8: Merge "Fix NPE when handling certain kinds of ANRs." into gingerbread
Merge commit '567c00a86f748ad4d798ae50a09505cc051fc095' into gingerbread-plus-aosp * commit '567c00a86f748ad4d798ae50a09505cc051fc095': Fix NPE when handling certain kinds of ANRs.
-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 3b3c483179..dea7936f19 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();
+ }
}
}
}