diff options
| author | 2017-08-24 00:11:54 +0000 | |
|---|---|---|
| committer | 2017-08-24 00:11:54 +0000 | |
| commit | 5cc643fa61d4c3b0e16418a1a55e0cca25019a2f (patch) | |
| tree | 964b1d67bb6237e18fef59a0feea76ca95cf81ff | |
| parent | f4fdf645ae866f2248c431f1d6ee3d10dc28498b (diff) | |
| parent | 12b91559ce73e2dd7b435705c7ea67d9e578cab1 (diff) | |
Merge "Fixed synchronization when calling cancellation signal." into oc-mr1-dev am: 102e6631cf
am: 12b91559ce
Change-Id: Ieaeb8ae7cb765f493492d267e9f73bbe3b7d3b57
| -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(); |