diff options
| author | Feng Cao <fengcao@google.com> | 2020-02-18 18:23:30 -0800 |
|---|---|---|
| committer | Feng Cao <fengcao@google.com> | 2020-02-19 09:42:22 -0800 |
| commit | 36960ee20ea612b2df2447d73003ac4af6f32341 (patch) | |
| tree | f3fce1a058820be899eead740f2f0186d401ab67 /core/java/android/inputmethodservice/IInputMethodWrapper.java | |
| parent | da0c5df4af50a670c8a1928b46d5e4d1e9a63f2f (diff) | |
Introduces the Bundle to inline suggestions APIs to encode custom UI styling information.
* The bundle will be generated/consumed by the support library.
* More API documentation and example usage will be added later once we have the support library impl ready.
* The old style resource name approach doesn't work due to the potential mismatch in the support library version across the host IME and the platform renderer service, and the non-static nature of the public attribute int id in the support lib.
* The Bundle added to the onCreateInlineSuggestionsRequest() is intended for the platform/ExtServices to communicate the UI versions it supports.
* The Bundle added to the InlinePresentationSpec is intended for the IME to communicate the custom styles for the chosen UI versions.
Test: manual verification, and also atest CtsInputMethodTestCases:InlineSuggestionInfoTest CtsInputMethodTestCases:InlineSuggestionTest CtsInputMethodTestCases:InlineSuggestionsRequestTest CtsInputMethodTestCases:InlineSuggestionsResponseTest
Bug: 146454892
Change-Id: Id7fea32a7550fb924fec811b376790474a7b92eb
Diffstat (limited to 'core/java/android/inputmethodservice/IInputMethodWrapper.java')
| -rw-r--r-- | core/java/android/inputmethodservice/IInputMethodWrapper.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/IInputMethodWrapper.java b/core/java/android/inputmethodservice/IInputMethodWrapper.java index 2a441de067c6..f0b1eaa9f257 100644 --- a/core/java/android/inputmethodservice/IInputMethodWrapper.java +++ b/core/java/android/inputmethodservice/IInputMethodWrapper.java @@ -19,7 +19,6 @@ package android.inputmethodservice; import android.annotation.BinderThread; import android.annotation.MainThread; import android.compat.annotation.UnsupportedAppUsage; -import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.os.Binder; @@ -29,7 +28,6 @@ import android.os.RemoteException; import android.os.ResultReceiver; import android.util.Log; import android.view.InputChannel; -import android.view.autofill.AutofillId; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputBinding; import android.view.inputmethod.InputConnection; @@ -46,6 +44,7 @@ import com.android.internal.view.IInputContext; import com.android.internal.view.IInputMethod; import com.android.internal.view.IInputMethodSession; import com.android.internal.view.IInputSessionCallback; +import com.android.internal.view.InlineSuggestionsRequestInfo; import com.android.internal.view.InputConnectionWrapper; import java.io.FileDescriptor; @@ -233,8 +232,9 @@ class IInputMethodWrapper extends IInputMethod.Stub return; case DO_CREATE_INLINE_SUGGESTIONS_REQUEST: args = (SomeArgs) msg.obj; - inputMethod.onCreateInlineSuggestionsRequest((ComponentName) args.arg1, - (AutofillId) args.arg2, (IInlineSuggestionsRequestCallback) args.arg3); + inputMethod.onCreateInlineSuggestionsRequest( + (InlineSuggestionsRequestInfo) args.arg1, + (IInlineSuggestionsRequestCallback) args.arg2); return; } @@ -279,11 +279,10 @@ class IInputMethodWrapper extends IInputMethod.Stub @BinderThread @Override - public void onCreateInlineSuggestionsRequest(ComponentName componentName, AutofillId autofillId, + public void onCreateInlineSuggestionsRequest(InlineSuggestionsRequestInfo requestInfo, IInlineSuggestionsRequestCallback cb) { mCaller.executeOrSendMessage( - mCaller.obtainMessageOOO(DO_CREATE_INLINE_SUGGESTIONS_REQUEST, componentName, - autofillId, cb)); + mCaller.obtainMessageOO(DO_CREATE_INLINE_SUGGESTIONS_REQUEST, requestInfo, cb)); } @BinderThread |
