Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed6a189e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in onTransactionResponse callback" into main

parents 874bddff bf6c7fd5
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -492,14 +492,21 @@ import java.util.concurrent.atomic.AtomicInteger;
    /* package */
    void onTransactionResponse(int transactionId, boolean success) {
        TransactionAcceptConditions conditions =
                transaction -> transaction.getTransactionId() == transactionId;
                transaction -> {
                    if (transaction.getTransactionId() != transactionId) {
                        Log.w(
                                TAG,
                                "Unexpected transaction: expected "
                                        + transactionId
                                        + ", received "
                                        + transaction.getTransactionId());
                        return false;
                    }
                    return true;
                };
        ContextHubServiceTransaction transaction = getTransactionAndHandleNext(conditions);
        if (transaction == null) {
            Log.w(TAG, "Received unexpected transaction response (expected ID = "
                    + transactionId
                    + ", received ID = "
                    + transaction.getTransactionId()
                    + ")");
            Log.w(TAG, "Received unexpected transaction response");
            return;
        }

@@ -581,7 +588,7 @@ import java.util.concurrent.atomic.AtomicInteger;
                transaction.getTransactionType() == ContextHubTransaction.TYPE_QUERY_NANOAPPS;
        ContextHubServiceTransaction transaction = getTransactionAndHandleNext(conditions);
        if (transaction == null) {
            Log.w(TAG, "Received unexpected query response (expected " + transaction + ")");
            Log.w(TAG, "Received unexpected query response");
            return;
        }