Loading core/java/com/android/internal/inputmethod/IInputContextInvoker.java +71 −55 Original line number Diff line number Diff line Loading @@ -57,9 +57,14 @@ public final class IInputContextInvoker { return new IInputContextInvoker(inputContext); } @NonNull InputConnectionCommandHeader createHeader() { return new InputConnectionCommandHeader(); } /** * Invokes {@link IInputContext#getTextAfterCursor(int, int, * com.android.internal.inputmethod.ICharSequenceResultCallback)}. * Invokes {@link IInputContext#getTextAfterCursor(InputConnectionCommandHeader, int, int, * AndroidFuture)}. * * @param length {@code length} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -71,7 +76,7 @@ public final class IInputContextInvoker { public AndroidFuture<CharSequence> getTextAfterCursor(int length, int flags) { final AndroidFuture<CharSequence> future = new AndroidFuture<>(); try { mIInputContext.getTextAfterCursor(length, flags, future); mIInputContext.getTextAfterCursor(createHeader(), length, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -79,7 +84,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getTextBeforeCursor(int, int, ICharSequenceResultCallback)}. * Invokes {@link IInputContext#getTextBeforeCursor(InputConnectionCommandHeader, int, int, * AndroidFuture)}. * * @param length {@code length} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -91,7 +97,7 @@ public final class IInputContextInvoker { public AndroidFuture<CharSequence> getTextBeforeCursor(int length, int flags) { final AndroidFuture<CharSequence> future = new AndroidFuture<>(); try { mIInputContext.getTextBeforeCursor(length, flags, future); mIInputContext.getTextBeforeCursor(createHeader(), length, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -99,7 +105,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getSelectedText(int, ICharSequenceResultCallback)}. * Invokes * {@link IInputContext#getSelectedText(InputConnectionCommandHeader, int, AndroidFuture)}. * * @param flags {@code flags} parameter to be passed. * @return {@link AndroidFuture<CharSequence>} that can be used to retrieve the invocation Loading @@ -110,7 +117,7 @@ public final class IInputContextInvoker { public AndroidFuture<CharSequence> getSelectedText(int flags) { final AndroidFuture<CharSequence> future = new AndroidFuture<>(); try { mIInputContext.getSelectedText(flags, future); mIInputContext.getSelectedText(createHeader(), flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -119,7 +126,8 @@ public final class IInputContextInvoker { /** * Invokes * {@link IInputContext#getSurroundingText(int, int, int, ISurroundingTextResultCallback)}. * {@link IInputContext#getSurroundingText(InputConnectionCommandHeader, int, int, int, * AndroidFuture)}. * * @param beforeLength {@code beforeLength} parameter to be passed. * @param afterLength {@code afterLength} parameter to be passed. Loading @@ -133,7 +141,8 @@ public final class IInputContextInvoker { int flags) { final AndroidFuture<SurroundingText> future = new AndroidFuture<>(); try { mIInputContext.getSurroundingText(beforeLength, afterLength, flags, future); mIInputContext.getSurroundingText(createHeader(), beforeLength, afterLength, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -141,7 +150,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getCursorCapsMode(int, IIntResultCallback)}. * Invokes * {@link IInputContext#getCursorCapsMode(InputConnectionCommandHeader, int, AndroidFuture)}. * * @param reqModes {@code reqModes} parameter to be passed. * @return {@link AndroidFuture<Integer>} that can be used to retrieve the invocation Loading @@ -152,7 +162,7 @@ public final class IInputContextInvoker { public AndroidFuture<Integer> getCursorCapsMode(int reqModes) { final AndroidFuture<Integer> future = new AndroidFuture<>(); try { mIInputContext.getCursorCapsMode(reqModes, future); mIInputContext.getCursorCapsMode(createHeader(), reqModes, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -160,8 +170,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getExtractedText(ExtractedTextRequest, int, * IExtractedTextResultCallback)}. * Invokes {@link IInputContext#getExtractedText(InputConnectionCommandHeader, * ExtractedTextRequest, int, AndroidFuture)}. * * @param request {@code request} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -174,7 +184,7 @@ public final class IInputContextInvoker { int flags) { final AndroidFuture<ExtractedText> future = new AndroidFuture<>(); try { mIInputContext.getExtractedText(request, flags, future); mIInputContext.getExtractedText(createHeader(), request, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -182,7 +192,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#commitText(CharSequence, int)}. * Invokes {@link IInputContext#commitText(InputConnectionCommandHeader, CharSequence, int)}. * * @param text {@code text} parameter to be passed. * @param newCursorPosition {@code newCursorPosition} parameter to be passed. Loading @@ -192,7 +202,7 @@ public final class IInputContextInvoker { @AnyThread public boolean commitText(CharSequence text, int newCursorPosition) { try { mIInputContext.commitText(text, newCursorPosition); mIInputContext.commitText(createHeader(), text, newCursorPosition); return true; } catch (RemoteException e) { return false; Loading @@ -200,7 +210,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#commitCompletion(CompletionInfo)}. * Invokes {@link IInputContext#commitCompletion(InputConnectionCommandHeader, CompletionInfo)}. * * @param text {@code text} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -209,7 +219,7 @@ public final class IInputContextInvoker { @AnyThread public boolean commitCompletion(CompletionInfo text) { try { mIInputContext.commitCompletion(text); mIInputContext.commitCompletion(createHeader(), text); return true; } catch (RemoteException e) { return false; Loading @@ -217,7 +227,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#commitCorrection(CorrectionInfo)}. * Invokes {@link IInputContext#commitCorrection(InputConnectionCommandHeader, CorrectionInfo)}. * * @param correctionInfo {@code correctionInfo} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -226,7 +236,7 @@ public final class IInputContextInvoker { @AnyThread public boolean commitCorrection(CorrectionInfo correctionInfo) { try { mIInputContext.commitCorrection(correctionInfo); mIInputContext.commitCorrection(createHeader(), correctionInfo); return true; } catch (RemoteException e) { return false; Loading @@ -234,7 +244,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setSelection(int, int)}. * Invokes {@link IInputContext#setSelection(InputConnectionCommandHeader, int, int)}. * * @param start {@code start} parameter to be passed. * @param end {@code start} parameter to be passed. Loading @@ -244,7 +254,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setSelection(int start, int end) { try { mIInputContext.setSelection(start, end); mIInputContext.setSelection(createHeader(), start, end); return true; } catch (RemoteException e) { return false; Loading @@ -252,7 +262,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performEditorAction(int)}. * Invokes {@link IInputContext#performEditorAction(InputConnectionCommandHeader, int)}. * * @param actionCode {@code start} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -261,7 +271,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performEditorAction(int actionCode) { try { mIInputContext.performEditorAction(actionCode); mIInputContext.performEditorAction(createHeader(), actionCode); return true; } catch (RemoteException e) { return false; Loading @@ -269,7 +279,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performContextMenuAction(id)}. * Invokes {@link IInputContext#performContextMenuAction(InputConnectionCommandHeader, int)}. * * @param id {@code id} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -278,7 +288,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performContextMenuAction(int id) { try { mIInputContext.performContextMenuAction(id); mIInputContext.performContextMenuAction(createHeader(), id); return true; } catch (RemoteException e) { return false; Loading @@ -286,7 +296,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setComposingRegion(int, int)}. * Invokes {@link IInputContext#setComposingRegion(InputConnectionCommandHeader, int, int)}. * * @param start {@code id} parameter to be passed. * @param end {@code id} parameter to be passed. Loading @@ -296,7 +306,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setComposingRegion(int start, int end) { try { mIInputContext.setComposingRegion(start, end); mIInputContext.setComposingRegion(createHeader(), start, end); return true; } catch (RemoteException e) { return false; Loading @@ -304,7 +314,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setComposingText(CharSequence, int)}. * Invokes * {@link IInputContext#setComposingText(InputConnectionCommandHeader, CharSequence, int)}. * * @param text {@code text} parameter to be passed. * @param newCursorPosition {@code newCursorPosition} parameter to be passed. Loading @@ -314,7 +325,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setComposingText(CharSequence text, int newCursorPosition) { try { mIInputContext.setComposingText(text, newCursorPosition); mIInputContext.setComposingText(createHeader(), text, newCursorPosition); return true; } catch (RemoteException e) { return false; Loading @@ -322,7 +333,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#finishComposingText()}. * Invokes {@link IInputContext#finishComposingText(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -330,7 +341,7 @@ public final class IInputContextInvoker { @AnyThread public boolean finishComposingText() { try { mIInputContext.finishComposingText(); mIInputContext.finishComposingText(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -338,7 +349,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#beginBatchEdit()}. * Invokes {@link IInputContext#beginBatchEdit(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -346,7 +357,7 @@ public final class IInputContextInvoker { @AnyThread public boolean beginBatchEdit() { try { mIInputContext.beginBatchEdit(); mIInputContext.beginBatchEdit(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -354,7 +365,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#endBatchEdit()}. * Invokes {@link IInputContext#endBatchEdit(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -362,7 +373,7 @@ public final class IInputContextInvoker { @AnyThread public boolean endBatchEdit() { try { mIInputContext.endBatchEdit(); mIInputContext.endBatchEdit(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -370,7 +381,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#sendKeyEvent(KeyEvent)}. * Invokes {@link IInputContext#sendKeyEvent(InputConnectionCommandHeader, KeyEvent)}. * * @param event {@code event} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -379,7 +390,7 @@ public final class IInputContextInvoker { @AnyThread public boolean sendKeyEvent(KeyEvent event) { try { mIInputContext.sendKeyEvent(event); mIInputContext.sendKeyEvent(createHeader(), event); return true; } catch (RemoteException e) { return false; Loading @@ -387,7 +398,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#clearMetaKeyStates(int)}. * Invokes {@link IInputContext#clearMetaKeyStates(InputConnectionCommandHeader, int)}. * * @param states {@code states} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -396,7 +407,7 @@ public final class IInputContextInvoker { @AnyThread public boolean clearMetaKeyStates(int states) { try { mIInputContext.clearMetaKeyStates(states); mIInputContext.clearMetaKeyStates(createHeader(), states); return true; } catch (RemoteException e) { return false; Loading @@ -404,7 +415,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#deleteSurroundingText(int, int)}. * Invokes {@link IInputContext#deleteSurroundingText(InputConnectionCommandHeader, int, int)}. * * @param beforeLength {@code beforeLength} parameter to be passed. * @param afterLength {@code afterLength} parameter to be passed. Loading @@ -414,7 +425,7 @@ public final class IInputContextInvoker { @AnyThread public boolean deleteSurroundingText(int beforeLength, int afterLength) { try { mIInputContext.deleteSurroundingText(beforeLength, afterLength); mIInputContext.deleteSurroundingText(createHeader(), beforeLength, afterLength); return true; } catch (RemoteException e) { return false; Loading @@ -422,7 +433,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#deleteSurroundingTextInCodePoints(int, int)}. * Invokes {@link IInputContext#deleteSurroundingTextInCodePoints(InputConnectionCommandHeader, * int, int)}. * * @param beforeLength {@code beforeLength} parameter to be passed. * @param afterLength {@code afterLength} parameter to be passed. Loading @@ -432,7 +444,8 @@ public final class IInputContextInvoker { @AnyThread public boolean deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) { try { mIInputContext.deleteSurroundingTextInCodePoints(beforeLength, afterLength); mIInputContext.deleteSurroundingTextInCodePoints(createHeader(), beforeLength, afterLength); return true; } catch (RemoteException e) { return false; Loading @@ -440,7 +453,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performSpellCheck()}. * Invokes {@link IInputContext#performSpellCheck(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -448,7 +461,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performSpellCheck() { try { mIInputContext.performSpellCheck(); mIInputContext.performSpellCheck(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -456,7 +469,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performPrivateCommand(String, Bundle)}. * Invokes * {@link IInputContext#performPrivateCommand(InputConnectionCommandHeader, String, Bundle)}. * * @param action {@code action} parameter to be passed. * @param data {@code data} parameter to be passed. Loading @@ -466,7 +480,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performPrivateCommand(String action, Bundle data) { try { mIInputContext.performPrivateCommand(action, data); mIInputContext.performPrivateCommand(createHeader(), action, data); return true; } catch (RemoteException e) { return false; Loading @@ -474,7 +488,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#requestCursorUpdates(int, IIntResultCallback)}. * Invokes {@link IInputContext#requestCursorUpdates(InputConnectionCommandHeader, int, int, * AndroidFuture)}. * * @param cursorUpdateMode {@code cursorUpdateMode} parameter to be passed. * @param imeDisplayId the display ID that is associated with the IME. Loading @@ -486,7 +501,8 @@ public final class IInputContextInvoker { public AndroidFuture<Boolean> requestCursorUpdates(int cursorUpdateMode, int imeDisplayId) { final AndroidFuture<Boolean> future = new AndroidFuture<>(); try { mIInputContext.requestCursorUpdates(cursorUpdateMode, imeDisplayId, future); mIInputContext.requestCursorUpdates(createHeader(), cursorUpdateMode, imeDisplayId, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -494,8 +510,8 @@ public final class IInputContextInvoker { } /** * Invokes * {@link IInputContext#commitContent(InputContentInfo, int, Bundle, IIntResultCallback)}. * Invokes {@link IInputContext#commitContent(InputConnectionCommandHeader, InputContentInfo, * int, Bundle, AndroidFuture)}. * * @param inputContentInfo {@code inputContentInfo} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -509,7 +525,7 @@ public final class IInputContextInvoker { Bundle opts) { final AndroidFuture<Boolean> future = new AndroidFuture<>(); try { mIInputContext.commitContent(inputContentInfo, flags, opts, future); mIInputContext.commitContent(createHeader(), inputContentInfo, flags, opts, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -517,7 +533,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setImeConsumesInput(boolean)}. * Invokes {@link IInputContext#setImeConsumesInput(InputConnectionCommandHeader, boolean)}. * * @param imeConsumesInput {@code imeConsumesInput} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -526,7 +542,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setImeConsumesInput(boolean imeConsumesInput) { try { mIInputContext.setImeConsumesInput(imeConsumesInput); mIInputContext.setImeConsumesInput(createHeader(), imeConsumesInput); return true; } catch (RemoteException e) { return false; Loading core/java/com/android/internal/inputmethod/InputConnectionCommandHeader.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.inputmethod; parcelable InputConnectionCommandHeader; No newline at end of file core/java/com/android/internal/inputmethod/InputConnectionCommandHeader.java 0 → 100644 +53 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.inputmethod; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; /** * A common IPC header used behind {@link RemoteInputConnectionImpl} and * {@link android.inputmethodservice.RemoteInputConnection}. */ public final class InputConnectionCommandHeader implements Parcelable { public InputConnectionCommandHeader() { } @Override public int describeContents() { return 0; } @NonNull public static final Parcelable.Creator<InputConnectionCommandHeader> CREATOR = new Parcelable.Creator<InputConnectionCommandHeader>() { @NonNull public InputConnectionCommandHeader createFromParcel(Parcel in) { return new InputConnectionCommandHeader(); } @NonNull public InputConnectionCommandHeader[] newArray(int size) { return new InputConnectionCommandHeader[size]; } }; @Override public void writeToParcel(@NonNull Parcel dest, int flags) { } } core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java +37 −29 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/com/android/internal/view/IInputContext.aidl +40 −30 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputContentInfo; import com.android.internal.infra.AndroidFuture; import com.android.internal.inputmethod.InputConnectionCommandHeader; /** * Interface from an input method to the application, allowing it to perform Loading @@ -31,58 +32,67 @@ import com.android.internal.infra.AndroidFuture; * {@hide} */ oneway interface IInputContext { void getTextBeforeCursor(int length, int flags, in AndroidFuture future /* T=CharSequence */); void getTextBeforeCursor(in InputConnectionCommandHeader header, int length, int flags, in AndroidFuture future /* T=CharSequence */); void getTextAfterCursor(int length, int flags, in AndroidFuture future /* T=CharSequence */); void getTextAfterCursor(in InputConnectionCommandHeader header, int length, int flags, in AndroidFuture future /* T=CharSequence */); void getCursorCapsMode(int reqModes, in AndroidFuture future /* T=Integer */); void getCursorCapsMode(in InputConnectionCommandHeader header, int reqModes, in AndroidFuture future /* T=Integer */); void getExtractedText(in ExtractedTextRequest request, int flags, in AndroidFuture future /* T=ExtractedText */); void getExtractedText(in InputConnectionCommandHeader header, in ExtractedTextRequest request, int flags, in AndroidFuture future /* T=ExtractedText */); void deleteSurroundingText(int beforeLength, int afterLength); void deleteSurroundingTextInCodePoints(int beforeLength, int afterLength); void deleteSurroundingText(in InputConnectionCommandHeader header, int beforeLength, int afterLength); void deleteSurroundingTextInCodePoints(in InputConnectionCommandHeader header, int beforeLength, int afterLength); void setComposingText(CharSequence text, int newCursorPosition); void setComposingText(in InputConnectionCommandHeader header, CharSequence text, int newCursorPosition); void finishComposingText(); void finishComposingText(in InputConnectionCommandHeader header); void commitText(CharSequence text, int newCursorPosition); void commitText(in InputConnectionCommandHeader header, CharSequence text, int newCursorPosition); void commitCompletion(in CompletionInfo completion); void commitCompletion(in InputConnectionCommandHeader header, in CompletionInfo completion); void commitCorrection(in CorrectionInfo correction); void commitCorrection(in InputConnectionCommandHeader header, in CorrectionInfo correction); void setSelection(int start, int end); void setSelection(in InputConnectionCommandHeader header, int start, int end); void performEditorAction(int actionCode); void performEditorAction(in InputConnectionCommandHeader header, int actionCode); void performContextMenuAction(int id); void performContextMenuAction(in InputConnectionCommandHeader header, int id); void beginBatchEdit(); void beginBatchEdit(in InputConnectionCommandHeader header); void endBatchEdit(); void endBatchEdit(in InputConnectionCommandHeader header); void sendKeyEvent(in KeyEvent event); void sendKeyEvent(in InputConnectionCommandHeader header, in KeyEvent event); void clearMetaKeyStates(int states); void clearMetaKeyStates(in InputConnectionCommandHeader header, int states); void performSpellCheck(); void performSpellCheck(in InputConnectionCommandHeader header); void performPrivateCommand(String action, in Bundle data); void performPrivateCommand(in InputConnectionCommandHeader header, String action, in Bundle data); void setComposingRegion(int start, int end); void setComposingRegion(in InputConnectionCommandHeader header, int start, int end); void getSelectedText(int flags, in AndroidFuture future /* T=CharSequence */); void getSelectedText(in InputConnectionCommandHeader header, int flags, in AndroidFuture future /* T=CharSequence */); void requestCursorUpdates(int cursorUpdateMode, int imeDisplayId, in AndroidFuture future /* T=Boolean */); void requestCursorUpdates(in InputConnectionCommandHeader header, int cursorUpdateMode, int imeDisplayId, in AndroidFuture future /* T=Boolean */); void commitContent(in InputContentInfo inputContentInfo, int flags, in Bundle opts, in AndroidFuture future /* T=Boolean */); void commitContent(in InputConnectionCommandHeader header, in InputContentInfo inputContentInfo, int flags, in Bundle opts, in AndroidFuture future /* T=Boolean */); void getSurroundingText(int beforeLength, int afterLength, int flags, in AndroidFuture future /* T=SurroundingText */); void getSurroundingText(in InputConnectionCommandHeader header, int beforeLength, int afterLength, int flags, in AndroidFuture future /* T=SurroundingText */); void setImeConsumesInput(boolean imeConsumesInput); void setImeConsumesInput(in InputConnectionCommandHeader header, boolean imeConsumesInput); } Loading
core/java/com/android/internal/inputmethod/IInputContextInvoker.java +71 −55 Original line number Diff line number Diff line Loading @@ -57,9 +57,14 @@ public final class IInputContextInvoker { return new IInputContextInvoker(inputContext); } @NonNull InputConnectionCommandHeader createHeader() { return new InputConnectionCommandHeader(); } /** * Invokes {@link IInputContext#getTextAfterCursor(int, int, * com.android.internal.inputmethod.ICharSequenceResultCallback)}. * Invokes {@link IInputContext#getTextAfterCursor(InputConnectionCommandHeader, int, int, * AndroidFuture)}. * * @param length {@code length} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -71,7 +76,7 @@ public final class IInputContextInvoker { public AndroidFuture<CharSequence> getTextAfterCursor(int length, int flags) { final AndroidFuture<CharSequence> future = new AndroidFuture<>(); try { mIInputContext.getTextAfterCursor(length, flags, future); mIInputContext.getTextAfterCursor(createHeader(), length, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -79,7 +84,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getTextBeforeCursor(int, int, ICharSequenceResultCallback)}. * Invokes {@link IInputContext#getTextBeforeCursor(InputConnectionCommandHeader, int, int, * AndroidFuture)}. * * @param length {@code length} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -91,7 +97,7 @@ public final class IInputContextInvoker { public AndroidFuture<CharSequence> getTextBeforeCursor(int length, int flags) { final AndroidFuture<CharSequence> future = new AndroidFuture<>(); try { mIInputContext.getTextBeforeCursor(length, flags, future); mIInputContext.getTextBeforeCursor(createHeader(), length, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -99,7 +105,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getSelectedText(int, ICharSequenceResultCallback)}. * Invokes * {@link IInputContext#getSelectedText(InputConnectionCommandHeader, int, AndroidFuture)}. * * @param flags {@code flags} parameter to be passed. * @return {@link AndroidFuture<CharSequence>} that can be used to retrieve the invocation Loading @@ -110,7 +117,7 @@ public final class IInputContextInvoker { public AndroidFuture<CharSequence> getSelectedText(int flags) { final AndroidFuture<CharSequence> future = new AndroidFuture<>(); try { mIInputContext.getSelectedText(flags, future); mIInputContext.getSelectedText(createHeader(), flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -119,7 +126,8 @@ public final class IInputContextInvoker { /** * Invokes * {@link IInputContext#getSurroundingText(int, int, int, ISurroundingTextResultCallback)}. * {@link IInputContext#getSurroundingText(InputConnectionCommandHeader, int, int, int, * AndroidFuture)}. * * @param beforeLength {@code beforeLength} parameter to be passed. * @param afterLength {@code afterLength} parameter to be passed. Loading @@ -133,7 +141,8 @@ public final class IInputContextInvoker { int flags) { final AndroidFuture<SurroundingText> future = new AndroidFuture<>(); try { mIInputContext.getSurroundingText(beforeLength, afterLength, flags, future); mIInputContext.getSurroundingText(createHeader(), beforeLength, afterLength, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -141,7 +150,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getCursorCapsMode(int, IIntResultCallback)}. * Invokes * {@link IInputContext#getCursorCapsMode(InputConnectionCommandHeader, int, AndroidFuture)}. * * @param reqModes {@code reqModes} parameter to be passed. * @return {@link AndroidFuture<Integer>} that can be used to retrieve the invocation Loading @@ -152,7 +162,7 @@ public final class IInputContextInvoker { public AndroidFuture<Integer> getCursorCapsMode(int reqModes) { final AndroidFuture<Integer> future = new AndroidFuture<>(); try { mIInputContext.getCursorCapsMode(reqModes, future); mIInputContext.getCursorCapsMode(createHeader(), reqModes, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -160,8 +170,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#getExtractedText(ExtractedTextRequest, int, * IExtractedTextResultCallback)}. * Invokes {@link IInputContext#getExtractedText(InputConnectionCommandHeader, * ExtractedTextRequest, int, AndroidFuture)}. * * @param request {@code request} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -174,7 +184,7 @@ public final class IInputContextInvoker { int flags) { final AndroidFuture<ExtractedText> future = new AndroidFuture<>(); try { mIInputContext.getExtractedText(request, flags, future); mIInputContext.getExtractedText(createHeader(), request, flags, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -182,7 +192,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#commitText(CharSequence, int)}. * Invokes {@link IInputContext#commitText(InputConnectionCommandHeader, CharSequence, int)}. * * @param text {@code text} parameter to be passed. * @param newCursorPosition {@code newCursorPosition} parameter to be passed. Loading @@ -192,7 +202,7 @@ public final class IInputContextInvoker { @AnyThread public boolean commitText(CharSequence text, int newCursorPosition) { try { mIInputContext.commitText(text, newCursorPosition); mIInputContext.commitText(createHeader(), text, newCursorPosition); return true; } catch (RemoteException e) { return false; Loading @@ -200,7 +210,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#commitCompletion(CompletionInfo)}. * Invokes {@link IInputContext#commitCompletion(InputConnectionCommandHeader, CompletionInfo)}. * * @param text {@code text} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -209,7 +219,7 @@ public final class IInputContextInvoker { @AnyThread public boolean commitCompletion(CompletionInfo text) { try { mIInputContext.commitCompletion(text); mIInputContext.commitCompletion(createHeader(), text); return true; } catch (RemoteException e) { return false; Loading @@ -217,7 +227,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#commitCorrection(CorrectionInfo)}. * Invokes {@link IInputContext#commitCorrection(InputConnectionCommandHeader, CorrectionInfo)}. * * @param correctionInfo {@code correctionInfo} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -226,7 +236,7 @@ public final class IInputContextInvoker { @AnyThread public boolean commitCorrection(CorrectionInfo correctionInfo) { try { mIInputContext.commitCorrection(correctionInfo); mIInputContext.commitCorrection(createHeader(), correctionInfo); return true; } catch (RemoteException e) { return false; Loading @@ -234,7 +244,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setSelection(int, int)}. * Invokes {@link IInputContext#setSelection(InputConnectionCommandHeader, int, int)}. * * @param start {@code start} parameter to be passed. * @param end {@code start} parameter to be passed. Loading @@ -244,7 +254,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setSelection(int start, int end) { try { mIInputContext.setSelection(start, end); mIInputContext.setSelection(createHeader(), start, end); return true; } catch (RemoteException e) { return false; Loading @@ -252,7 +262,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performEditorAction(int)}. * Invokes {@link IInputContext#performEditorAction(InputConnectionCommandHeader, int)}. * * @param actionCode {@code start} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -261,7 +271,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performEditorAction(int actionCode) { try { mIInputContext.performEditorAction(actionCode); mIInputContext.performEditorAction(createHeader(), actionCode); return true; } catch (RemoteException e) { return false; Loading @@ -269,7 +279,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performContextMenuAction(id)}. * Invokes {@link IInputContext#performContextMenuAction(InputConnectionCommandHeader, int)}. * * @param id {@code id} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -278,7 +288,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performContextMenuAction(int id) { try { mIInputContext.performContextMenuAction(id); mIInputContext.performContextMenuAction(createHeader(), id); return true; } catch (RemoteException e) { return false; Loading @@ -286,7 +296,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setComposingRegion(int, int)}. * Invokes {@link IInputContext#setComposingRegion(InputConnectionCommandHeader, int, int)}. * * @param start {@code id} parameter to be passed. * @param end {@code id} parameter to be passed. Loading @@ -296,7 +306,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setComposingRegion(int start, int end) { try { mIInputContext.setComposingRegion(start, end); mIInputContext.setComposingRegion(createHeader(), start, end); return true; } catch (RemoteException e) { return false; Loading @@ -304,7 +314,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setComposingText(CharSequence, int)}. * Invokes * {@link IInputContext#setComposingText(InputConnectionCommandHeader, CharSequence, int)}. * * @param text {@code text} parameter to be passed. * @param newCursorPosition {@code newCursorPosition} parameter to be passed. Loading @@ -314,7 +325,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setComposingText(CharSequence text, int newCursorPosition) { try { mIInputContext.setComposingText(text, newCursorPosition); mIInputContext.setComposingText(createHeader(), text, newCursorPosition); return true; } catch (RemoteException e) { return false; Loading @@ -322,7 +333,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#finishComposingText()}. * Invokes {@link IInputContext#finishComposingText(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -330,7 +341,7 @@ public final class IInputContextInvoker { @AnyThread public boolean finishComposingText() { try { mIInputContext.finishComposingText(); mIInputContext.finishComposingText(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -338,7 +349,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#beginBatchEdit()}. * Invokes {@link IInputContext#beginBatchEdit(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -346,7 +357,7 @@ public final class IInputContextInvoker { @AnyThread public boolean beginBatchEdit() { try { mIInputContext.beginBatchEdit(); mIInputContext.beginBatchEdit(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -354,7 +365,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#endBatchEdit()}. * Invokes {@link IInputContext#endBatchEdit(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -362,7 +373,7 @@ public final class IInputContextInvoker { @AnyThread public boolean endBatchEdit() { try { mIInputContext.endBatchEdit(); mIInputContext.endBatchEdit(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -370,7 +381,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#sendKeyEvent(KeyEvent)}. * Invokes {@link IInputContext#sendKeyEvent(InputConnectionCommandHeader, KeyEvent)}. * * @param event {@code event} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -379,7 +390,7 @@ public final class IInputContextInvoker { @AnyThread public boolean sendKeyEvent(KeyEvent event) { try { mIInputContext.sendKeyEvent(event); mIInputContext.sendKeyEvent(createHeader(), event); return true; } catch (RemoteException e) { return false; Loading @@ -387,7 +398,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#clearMetaKeyStates(int)}. * Invokes {@link IInputContext#clearMetaKeyStates(InputConnectionCommandHeader, int)}. * * @param states {@code states} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -396,7 +407,7 @@ public final class IInputContextInvoker { @AnyThread public boolean clearMetaKeyStates(int states) { try { mIInputContext.clearMetaKeyStates(states); mIInputContext.clearMetaKeyStates(createHeader(), states); return true; } catch (RemoteException e) { return false; Loading @@ -404,7 +415,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#deleteSurroundingText(int, int)}. * Invokes {@link IInputContext#deleteSurroundingText(InputConnectionCommandHeader, int, int)}. * * @param beforeLength {@code beforeLength} parameter to be passed. * @param afterLength {@code afterLength} parameter to be passed. Loading @@ -414,7 +425,7 @@ public final class IInputContextInvoker { @AnyThread public boolean deleteSurroundingText(int beforeLength, int afterLength) { try { mIInputContext.deleteSurroundingText(beforeLength, afterLength); mIInputContext.deleteSurroundingText(createHeader(), beforeLength, afterLength); return true; } catch (RemoteException e) { return false; Loading @@ -422,7 +433,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#deleteSurroundingTextInCodePoints(int, int)}. * Invokes {@link IInputContext#deleteSurroundingTextInCodePoints(InputConnectionCommandHeader, * int, int)}. * * @param beforeLength {@code beforeLength} parameter to be passed. * @param afterLength {@code afterLength} parameter to be passed. Loading @@ -432,7 +444,8 @@ public final class IInputContextInvoker { @AnyThread public boolean deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) { try { mIInputContext.deleteSurroundingTextInCodePoints(beforeLength, afterLength); mIInputContext.deleteSurroundingTextInCodePoints(createHeader(), beforeLength, afterLength); return true; } catch (RemoteException e) { return false; Loading @@ -440,7 +453,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performSpellCheck()}. * Invokes {@link IInputContext#performSpellCheck(InputConnectionCommandHeader)}. * * @return {@code true} if the invocation is completed without {@link RemoteException}. * {@code false} otherwise. Loading @@ -448,7 +461,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performSpellCheck() { try { mIInputContext.performSpellCheck(); mIInputContext.performSpellCheck(createHeader()); return true; } catch (RemoteException e) { return false; Loading @@ -456,7 +469,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#performPrivateCommand(String, Bundle)}. * Invokes * {@link IInputContext#performPrivateCommand(InputConnectionCommandHeader, String, Bundle)}. * * @param action {@code action} parameter to be passed. * @param data {@code data} parameter to be passed. Loading @@ -466,7 +480,7 @@ public final class IInputContextInvoker { @AnyThread public boolean performPrivateCommand(String action, Bundle data) { try { mIInputContext.performPrivateCommand(action, data); mIInputContext.performPrivateCommand(createHeader(), action, data); return true; } catch (RemoteException e) { return false; Loading @@ -474,7 +488,8 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#requestCursorUpdates(int, IIntResultCallback)}. * Invokes {@link IInputContext#requestCursorUpdates(InputConnectionCommandHeader, int, int, * AndroidFuture)}. * * @param cursorUpdateMode {@code cursorUpdateMode} parameter to be passed. * @param imeDisplayId the display ID that is associated with the IME. Loading @@ -486,7 +501,8 @@ public final class IInputContextInvoker { public AndroidFuture<Boolean> requestCursorUpdates(int cursorUpdateMode, int imeDisplayId) { final AndroidFuture<Boolean> future = new AndroidFuture<>(); try { mIInputContext.requestCursorUpdates(cursorUpdateMode, imeDisplayId, future); mIInputContext.requestCursorUpdates(createHeader(), cursorUpdateMode, imeDisplayId, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -494,8 +510,8 @@ public final class IInputContextInvoker { } /** * Invokes * {@link IInputContext#commitContent(InputContentInfo, int, Bundle, IIntResultCallback)}. * Invokes {@link IInputContext#commitContent(InputConnectionCommandHeader, InputContentInfo, * int, Bundle, AndroidFuture)}. * * @param inputContentInfo {@code inputContentInfo} parameter to be passed. * @param flags {@code flags} parameter to be passed. Loading @@ -509,7 +525,7 @@ public final class IInputContextInvoker { Bundle opts) { final AndroidFuture<Boolean> future = new AndroidFuture<>(); try { mIInputContext.commitContent(inputContentInfo, flags, opts, future); mIInputContext.commitContent(createHeader(), inputContentInfo, flags, opts, future); } catch (RemoteException e) { future.completeExceptionally(e); } Loading @@ -517,7 +533,7 @@ public final class IInputContextInvoker { } /** * Invokes {@link IInputContext#setImeConsumesInput(boolean)}. * Invokes {@link IInputContext#setImeConsumesInput(InputConnectionCommandHeader, boolean)}. * * @param imeConsumesInput {@code imeConsumesInput} parameter to be passed. * @return {@code true} if the invocation is completed without {@link RemoteException}. Loading @@ -526,7 +542,7 @@ public final class IInputContextInvoker { @AnyThread public boolean setImeConsumesInput(boolean imeConsumesInput) { try { mIInputContext.setImeConsumesInput(imeConsumesInput); mIInputContext.setImeConsumesInput(createHeader(), imeConsumesInput); return true; } catch (RemoteException e) { return false; Loading
core/java/com/android/internal/inputmethod/InputConnectionCommandHeader.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.inputmethod; parcelable InputConnectionCommandHeader; No newline at end of file
core/java/com/android/internal/inputmethod/InputConnectionCommandHeader.java 0 → 100644 +53 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.inputmethod; import android.annotation.NonNull; import android.os.Parcel; import android.os.Parcelable; /** * A common IPC header used behind {@link RemoteInputConnectionImpl} and * {@link android.inputmethodservice.RemoteInputConnection}. */ public final class InputConnectionCommandHeader implements Parcelable { public InputConnectionCommandHeader() { } @Override public int describeContents() { return 0; } @NonNull public static final Parcelable.Creator<InputConnectionCommandHeader> CREATOR = new Parcelable.Creator<InputConnectionCommandHeader>() { @NonNull public InputConnectionCommandHeader createFromParcel(Parcel in) { return new InputConnectionCommandHeader(); } @NonNull public InputConnectionCommandHeader[] newArray(int size) { return new InputConnectionCommandHeader[size]; } }; @Override public void writeToParcel(@NonNull Parcel dest, int flags) { } }
core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java +37 −29 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/com/android/internal/view/IInputContext.aidl +40 −30 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputContentInfo; import com.android.internal.infra.AndroidFuture; import com.android.internal.inputmethod.InputConnectionCommandHeader; /** * Interface from an input method to the application, allowing it to perform Loading @@ -31,58 +32,67 @@ import com.android.internal.infra.AndroidFuture; * {@hide} */ oneway interface IInputContext { void getTextBeforeCursor(int length, int flags, in AndroidFuture future /* T=CharSequence */); void getTextBeforeCursor(in InputConnectionCommandHeader header, int length, int flags, in AndroidFuture future /* T=CharSequence */); void getTextAfterCursor(int length, int flags, in AndroidFuture future /* T=CharSequence */); void getTextAfterCursor(in InputConnectionCommandHeader header, int length, int flags, in AndroidFuture future /* T=CharSequence */); void getCursorCapsMode(int reqModes, in AndroidFuture future /* T=Integer */); void getCursorCapsMode(in InputConnectionCommandHeader header, int reqModes, in AndroidFuture future /* T=Integer */); void getExtractedText(in ExtractedTextRequest request, int flags, in AndroidFuture future /* T=ExtractedText */); void getExtractedText(in InputConnectionCommandHeader header, in ExtractedTextRequest request, int flags, in AndroidFuture future /* T=ExtractedText */); void deleteSurroundingText(int beforeLength, int afterLength); void deleteSurroundingTextInCodePoints(int beforeLength, int afterLength); void deleteSurroundingText(in InputConnectionCommandHeader header, int beforeLength, int afterLength); void deleteSurroundingTextInCodePoints(in InputConnectionCommandHeader header, int beforeLength, int afterLength); void setComposingText(CharSequence text, int newCursorPosition); void setComposingText(in InputConnectionCommandHeader header, CharSequence text, int newCursorPosition); void finishComposingText(); void finishComposingText(in InputConnectionCommandHeader header); void commitText(CharSequence text, int newCursorPosition); void commitText(in InputConnectionCommandHeader header, CharSequence text, int newCursorPosition); void commitCompletion(in CompletionInfo completion); void commitCompletion(in InputConnectionCommandHeader header, in CompletionInfo completion); void commitCorrection(in CorrectionInfo correction); void commitCorrection(in InputConnectionCommandHeader header, in CorrectionInfo correction); void setSelection(int start, int end); void setSelection(in InputConnectionCommandHeader header, int start, int end); void performEditorAction(int actionCode); void performEditorAction(in InputConnectionCommandHeader header, int actionCode); void performContextMenuAction(int id); void performContextMenuAction(in InputConnectionCommandHeader header, int id); void beginBatchEdit(); void beginBatchEdit(in InputConnectionCommandHeader header); void endBatchEdit(); void endBatchEdit(in InputConnectionCommandHeader header); void sendKeyEvent(in KeyEvent event); void sendKeyEvent(in InputConnectionCommandHeader header, in KeyEvent event); void clearMetaKeyStates(int states); void clearMetaKeyStates(in InputConnectionCommandHeader header, int states); void performSpellCheck(); void performSpellCheck(in InputConnectionCommandHeader header); void performPrivateCommand(String action, in Bundle data); void performPrivateCommand(in InputConnectionCommandHeader header, String action, in Bundle data); void setComposingRegion(int start, int end); void setComposingRegion(in InputConnectionCommandHeader header, int start, int end); void getSelectedText(int flags, in AndroidFuture future /* T=CharSequence */); void getSelectedText(in InputConnectionCommandHeader header, int flags, in AndroidFuture future /* T=CharSequence */); void requestCursorUpdates(int cursorUpdateMode, int imeDisplayId, in AndroidFuture future /* T=Boolean */); void requestCursorUpdates(in InputConnectionCommandHeader header, int cursorUpdateMode, int imeDisplayId, in AndroidFuture future /* T=Boolean */); void commitContent(in InputContentInfo inputContentInfo, int flags, in Bundle opts, in AndroidFuture future /* T=Boolean */); void commitContent(in InputConnectionCommandHeader header, in InputContentInfo inputContentInfo, int flags, in Bundle opts, in AndroidFuture future /* T=Boolean */); void getSurroundingText(int beforeLength, int afterLength, int flags, in AndroidFuture future /* T=SurroundingText */); void getSurroundingText(in InputConnectionCommandHeader header, int beforeLength, int afterLength, int flags, in AndroidFuture future /* T=SurroundingText */); void setImeConsumesInput(boolean imeConsumesInput); void setImeConsumesInput(in InputConnectionCommandHeader header, boolean imeConsumesInput); }