Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eeb48a53 authored by Haoran Zhang's avatar Haoran Zhang
Browse files

[Autofill Framework] Add in null check before further processing inline request for augmented.

getRemoteAugmentedAutofillServiceLocked() can return null when there is no augmented autofill service set. We should add a null check here to prevent null pointer exception.

Bug: b/427159531
Test: atest CtsAutoFillServiceTestCases
Flag: android.service.autofill.add_null_check_for_augmented_inline_request
Change-Id: I46fde744385db9a10fbd993bf1d1fcb892bdb486
parent 9d9bc6d9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -143,3 +143,13 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "add_null_check_for_augmented_inline_request"
  namespace: "autofill"
  description: "Add null check for augmented inline request"
  bug: "427159531"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+7 −0
Original line number Diff line number Diff line
@@ -6717,6 +6717,13 @@ final class Session
        synchronized (mLock) {
            final RemoteAugmentedAutofillService remoteService =
                    mService.getRemoteAugmentedAutofillServiceLocked();
            if (Flags.addNullCheckForAugmentedInlineRequest() && remoteService == null) {
                Slog.i(
                        TAG,
                        "onAugmentedAutofillInlineSuggestionAccept(): no service for user, skipping"
                                + " processing inline suggestion request");
                return;
            }
            logAugmentedAutofillRequestLocked(
                    mode,
                    remoteService.getComponentName(),