Merge "Fix NPE when handling certain kinds of ANRs." into gingerbread

This commit is contained in:
Jeff Brown 2010-09-16 11:06:29 -07:00 committed by Android (Google) Code Review
commit 4fe5434b2d

View File

@ -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();
}
}
}
}