Commit 102e6631 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review

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

parents 4ce4d954 60b765b7
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment