diff --git a/core/java/android/service/autofill/InlineSuggestionRenderService.java b/core/java/android/service/autofill/InlineSuggestionRenderService.java index f0a72c501f776..7fbc309d308c2 100644 --- a/core/java/android/service/autofill/InlineSuggestionRenderService.java +++ b/core/java/android/service/autofill/InlineSuggestionRenderService.java @@ -97,6 +97,9 @@ public abstract class InlineSuggestionRenderService extends Service { host.setView(suggestionRoot, lp); suggestionRoot.setOnClickListener((v) -> { try { + if (suggestionView.hasOnClickListeners()) { + suggestionView.callOnClick(); + } callback.onClick(); } catch (RemoteException e) { Log.w(TAG, "RemoteException calling onClick()"); @@ -105,6 +108,9 @@ public abstract class InlineSuggestionRenderService extends Service { suggestionRoot.setOnLongClickListener((v) -> { try { + if (suggestionView.hasOnLongClickListeners()) { + suggestionView.performLongClick(); + } callback.onLongClick(); } catch (RemoteException e) { Log.w(TAG, "RemoteException calling onLongClick()"); diff --git a/core/java/android/service/autofill/InlineSuggestionRoot.java b/core/java/android/service/autofill/InlineSuggestionRoot.java index bdcc2531e4857..6c9d36b329ffa 100644 --- a/core/java/android/service/autofill/InlineSuggestionRoot.java +++ b/core/java/android/service/autofill/InlineSuggestionRoot.java @@ -51,6 +51,11 @@ public class InlineSuggestionRoot extends FrameLayout { setFocusable(false); } + @Override + public boolean onInterceptTouchEvent(MotionEvent ev) { + return true; + } + @Override @SuppressLint("ClickableViewAccessibility") public boolean onTouchEvent(@NonNull MotionEvent event) {