diff options
| author | 2010-09-16 11:06:29 -0700 | |
|---|---|---|
| committer | 2010-09-16 11:06:29 -0700 | |
| commit | 4fe5434b2d12888e12585f9a7286d3634ead22f0 (patch) | |
| tree | 394aead665bd535f75286bcb9b87940bbabade56 /libs/ui/InputDispatcher.cpp | |
| parent | c18411e67395eb6c8371dc51026cf638572d0d6e (diff) | |
| parent | 40ad4706434b40fa466b23c6e9f03f6dcc32c0c4 (diff) | |
Merge "Fix NPE when handling certain kinds of ANRs." into gingerbread
Diffstat (limited to 'libs/ui/InputDispatcher.cpp')
| -rw-r--r-- | libs/ui/InputDispatcher.cpp | 10 |
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(); + } } } } |