diff --git a/services/autofill/java/com/android/server/autofill/RemoteFillService.java b/services/autofill/java/com/android/server/autofill/RemoteFillService.java index 2a2797c160d88..f8c0e27643b3f 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. - remoteService.dispatchOnFillTimeout(mCancellation); + final ICancellationSignal cancellation = mCancellation; + if (cancellation != null) { + remoteService.dispatchOnFillTimeout(cancellation); + } remoteService.dispatchOnFillRequestFailure(PendingFillRequest.this, null); }