Fixed NPE when cancellation signal is null.

Test: none for this particular issue, but CtsAutoFillServiceTestCases pass
Fixes: 64759228

Change-Id: I34170440ac388ec6ba7ed5632dc38543a84d0327
This commit is contained in:
Felipe Leme
2017-08-16 12:29:53 -07:00
parent 9c43a77971
commit ec63b7d0e1

View File

@@ -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);
}