listener][handle->callbackIds]++; return NO_ERROR; }"> listener][handle->callbackIds]++; return NO_ERROR; }"> listener][handle->callbackIds]++; return NO_ERROR; }">
status_t TransactionCallbackInvoker::registerPendingCallbackHandle(
const sp<CallbackHandle>& handle) {
std::lock_guard lock(mMutex);
// If we can't find the transaction stats something has gone wrong. The client should call
// startRegistration before trying to register a pending callback handle.
TransactionStats* transactionStats;
status_t err = findTransactionStats(handle->listener, handle->callbackIds, &transactionStats);
if (err != NO_ERROR) {
ALOGE("cannot find transaction stats");
return err;
}
mPendingTransactions[handle->listener][handle->callbackIds]++;
return NO_ERROR;
}
mCompletedTransactions
查找 listener
和 callbackids
对应的 TransactionStats。mCompletedTransactions
是在 TransactionCallbackInvoker::startRegistration() 中写入的。mPendingTransactions
中对应 listener
和 callbackIds
计数加一。