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

Commit 60b765b7 authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixed synchronization when calling cancellation signal.

Test: none for this particular issue, but CtsAutoFillServiceTestCases pass

Bug: 64759228

Change-Id: Ifaf0082de55ddb5446af134e190c89f7e10bf1fe
parent fac2141f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -562,7 +562,10 @@ final class RemoteFillService implements DeathRecipient {
        void onTimeout(RemoteFillService remoteService) {
            // NOTE: Must make these 2 calls asynchronously, because the cancellation signal is
            // handled by the service, which could block.
            final ICancellationSignal cancellation = mCancellation;
            final ICancellationSignal cancellation;
            synchronized (mLock) {
                cancellation = mCancellation;
            }
            if (cancellation != null) {
                remoteService.dispatchOnFillTimeout(cancellation);
            }
@@ -587,7 +590,10 @@ final class RemoteFillService implements DeathRecipient {
        public boolean cancel() {
            if (!super.cancel()) return false;

            final ICancellationSignal cancellation = mCancellation;
            final ICancellationSignal cancellation;
            synchronized (mLock) {
                cancellation = mCancellation;
            }
            if (cancellation != null) {
                try {
                    cancellation.cancel();