OSDN Git Service

Fixed NPE when cancellation signal is null.
authorFelipe Leme <felipeal@google.com>
Wed, 16 Aug 2017 19:29:53 +0000 (12:29 -0700)
committerFelipe Leme <felipeal@google.com>
Thu, 17 Aug 2017 01:06:17 +0000 (18:06 -0700)
Test: none for this particular issue, but CtsAutoFillServiceTestCases pass
Fixes: 64759228

Change-Id: I34170440ac388ec6ba7ed5632dc38543a84d0327

services/autofill/java/com/android/server/autofill/RemoteFillService.java

index 2a2797c..f8c0e27 100644 (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);
         }