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

Commit be819304 authored by Matthew Sedam's avatar Matthew Sedam Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in ContextHubTransactionManager" into main

parents df269ae2 5d03ae81
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -412,10 +412,15 @@ import java.util.concurrent.atomic.AtomicInteger;
    /* package */
    synchronized void addTransaction(
            ContextHubServiceTransaction transaction) throws IllegalStateException {
        if (transaction == null) {
            return;
        }

        if (mTransactionQueue.size() == MAX_PENDING_REQUESTS) {
            throw new IllegalStateException("Transaction queue is full (capacity = "
                    + MAX_PENDING_REQUESTS + ")");
        }

        mTransactionQueue.add(transaction);
        mTransactionRecordDeque.add(new TransactionRecord(transaction.toString()));