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

Commit 12b91559 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Fixed synchronization when calling cancellation signal." into oc-mr1-dev

am: 102e6631

Change-Id: I8ed730d3634ae90559d0b5ca9de49834031af19d
parents 3a41d243 102e6631
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();