diff options
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/RemoteFillService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/autofill/java/com/android/server/autofill/RemoteFillService.java b/services/autofill/java/com/android/server/autofill/RemoteFillService.java index f8c0e27643b3..dd980535f628 100644 --- a/services/autofill/java/com/android/server/autofill/RemoteFillService.java +++ b/services/autofill/java/com/android/server/autofill/RemoteFillService.java @@ -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(); |