diff options
| author | Adam He <adamhe@google.com> | 2020-02-04 14:55:39 -0800 |
|---|---|---|
| committer | Adam He <adamhe@google.com> | 2020-02-14 11:15:43 -0800 |
| commit | 401162563844fe484e21082b25cf1843f393aaff (patch) | |
| tree | 9caf82a7b905dfe9768b5feaabdbbb082389f811 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 3eed34905131cec696f84b03091d01eb62364214 (diff) | |
Move rendering logic for inline suggestions to ExtServices.
Added a render service in ExtServices to connect to the renderer in
androidx.autofill for inline suggestion slices.
Cleaned up old UI rendering code that lived in system_server.
Bug: 146453086
Test: atest ExtServicesUnitTests
Change-Id: I25a7ea438afe524683671c850625ae80dacccfaa
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 49e1d5e4f213..a95938b5db2d 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -789,6 +789,7 @@ public class InputMethodService extends AbstractInputMethodService { Log.w(TAG, "onCreateInlineSuggestionsRequest() returned null request"); requestCallback.onInlineSuggestionsUnsupported(); } else { + request.setHostInputToken(getHostInputToken()); final IInlineSuggestionsResponseCallback inlineSuggestionsResponseCallback = new InlineSuggestionsResponseCallbackImpl(this, mInlineSuggestionsRequestInfo.mComponentName, @@ -833,6 +834,18 @@ public class InputMethodService extends AbstractInputMethodService { onInlineSuggestionsResponse(response); } + /** + * Returns the {@link IBinder} input token from the host view root. + */ + @Nullable + private IBinder getHostInputToken() { + ViewRootImpl viewRoot = null; + if (mRootView != null) { + viewRoot = mRootView.getViewRootImpl(); + } + return viewRoot == null ? null : viewRoot.getInputToken(); + } + private void notifyImeHidden() { setImeWindowStatus(IME_ACTIVE | IME_INVISIBLE, mBackDisposition); onPreRenderedWindowVisibilityChanged(false /* setVisible */); |
