From 4a9fc440b8511f8409dbf45fe0dec1dffd7936e7 Mon Sep 17 00:00:00 2001 From: hupeng3 Date: Mon, 6 Feb 2023 14:53:32 +0800 Subject: Toast: Solve the NPE problem in session.java In the if statement here, 'isFillDialogUiEnabled' should not be an independent '||' operation, which will cause the previous addition to be invalid. It should be in the same level as 'isViewFocusedLocked', and use 'isRequestSupportFillDialog' replace. Bug: 267986308 Test: Manual Signed-off-by: hupeng3 Change-Id: I8adc5eb7f24f2189e22b469f7c677bb2206cf3c8 --- services/autofill/java/com/android/server/autofill/Session.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 5c11e2c2327e..9c1933db8b37 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -3840,8 +3840,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState && (mSessionFlags.mAugmentedAutofillOnly || !mSessionFlags.mInlineSupportedByService || mSessionFlags.mExpiredResponse) - && isViewFocusedLocked(flags) - || isFillDialogUiEnabled()) { + && (isViewFocusedLocked(flags) || isRequestSupportFillDialog(flags))) { if (sDebug) Slog.d(TAG, "Create inline request for augmented autofill"); remoteRenderService.getInlineSuggestionsRendererInfo(new RemoteCallback( (extras) -> { -- cgit v1.2.3-59-g8ed1b