@@ -2698,6 +2698,11 @@ private void updateViewStateAndUiOnValueChangedLocked(AutofillId id, AutofillVal
26982698 // TODO(b/156099633): remove this once framework gets out of business of resending
26992699 // inline suggestions when IME visibility changes.
27002700 mInlineSessionController .hideInlineSuggestionsUiLocked (viewState .id );
2701+ try {
2702+ mClient .notifyFillUiHidden (this .id , viewState .id );
2703+ } catch (RemoteException e ) {
2704+ Slog .e (TAG , "Error requesting to hide fill UI" , e );
2705+ }
27012706 viewState .resetState (ViewState .STATE_CHANGED );
27022707 return ;
27032708 } else if ((viewState .id .equals (this .mCurrentViewId ))
@@ -2713,20 +2718,20 @@ private void updateViewStateAndUiOnValueChangedLocked(AutofillId id, AutofillVal
27132718 } else if (viewState .id .equals (this .mCurrentViewId )
27142719 && (viewState .getState () & ViewState .STATE_INLINE_SHOWN ) != 0 ) {
27152720 if ((viewState .getState () & ViewState .STATE_INLINE_DISABLED ) != 0 ) {
2716- final FillResponse response = viewState .getResponse ();
2717- if (response != null ) {
2718- response .getDatasets ().clear ();
2719- }
2720- mInlineSessionController .deleteInlineFillUiLocked (viewState .id );
2721- } else {
2722- mInlineSessionController .filterInlineFillUiLocked (mCurrentViewId , filterText );
2721+ mInlineSessionController .disableFilterMatching (viewState .id );
27232722 }
2723+ mInlineSessionController .filterInlineFillUiLocked (mCurrentViewId , filterText );
27242724 } else if (viewState .id .equals (this .mCurrentViewId )
27252725 && (viewState .getState () & ViewState .STATE_TRIGGERED_AUGMENTED_AUTOFILL ) != 0 ) {
27262726 if (!TextUtils .isEmpty (filterText )) {
27272727 // TODO: we should be able to replace this with controller#filterInlineFillUiLocked
27282728 // to accomplish filtering for augmented autofill.
27292729 mInlineSessionController .hideInlineSuggestionsUiLocked (mCurrentViewId );
2730+ try {
2731+ mClient .notifyFillUiHidden (this .id , mCurrentViewId );
2732+ } catch (RemoteException e ) {
2733+ Slog .e (TAG , "Error sending fill UI hidden notification" , e );
2734+ }
27302735 }
27312736 }
27322737
@@ -2812,6 +2817,11 @@ public void onFillReady(@NonNull FillResponse response, @NonNull AutofillId fill
28122817 if (requestShowInlineSuggestionsLocked (response , filterText )) {
28132818 final ViewState currentView = mViewStates .get (mCurrentViewId );
28142819 currentView .setState (ViewState .STATE_INLINE_SHOWN );
2820+ try {
2821+ mClient .notifyFillUiShown (this .id , mCurrentViewId );
2822+ } catch (RemoteException e ) {
2823+ Slog .e (TAG , "Error sending fill UI shown notification" , e );
2824+ }
28152825 //TODO(b/137800469): Fix it to log showed only when IME asks for inflation,
28162826 // rather than here where framework sends back the response.
28172827 mService .logDatasetShown (id , mClientState );
@@ -2882,6 +2892,11 @@ private boolean requestShowInlineSuggestionsLocked(@NonNull FillResponse respons
28822892 synchronized (mLock ) {
28832893 mInlineSessionController .hideInlineSuggestionsUiLocked (
28842894 focusedId );
2895+ try {
2896+ mClient .notifyFillUiHidden (this .id , focusedId );
2897+ } catch (RemoteException e ) {
2898+ Slog .e (TAG , "Error sending fill UI hidden notification" , e );
2899+ }
28852900 }
28862901 }, remoteRenderService );
28872902 return mInlineSessionController .setInlineFillUiLocked (inlineFillUi );
@@ -3393,6 +3408,11 @@ void autoFill(int requestId, int datasetIndex, Dataset dataset, boolean generate
33933408 }
33943409 if (mCurrentViewId != null ) {
33953410 mInlineSessionController .hideInlineSuggestionsUiLocked (mCurrentViewId );
3411+ try {
3412+ mClient .notifyFillUiHidden (this .id , mCurrentViewId );
3413+ } catch (RemoteException e ) {
3414+ Slog .e (TAG , "Error sending fill UI hidden notification" , e );
3415+ }
33963416 }
33973417 autoFillApp (dataset );
33983418 return ;
0 commit comments