FileDocCategorySizeDatePackage
InputConnectionWrapper.javaAPI DocAndroid 5.1 API15277Thu Mar 12 22:22:10 GMT 2015com.android.internal.view

InputConnectionWrapper

public class InputConnectionWrapper extends Object implements android.view.inputmethod.InputConnection

Fields Summary
private static final int
MAX_WAIT_TIME_MILLIS
private final IInputContext
mIInputContext
Constructors Summary
public InputConnectionWrapper(IInputContext inputContext)

        mIInputContext = inputContext;
    
Methods Summary
public booleanbeginBatchEdit()

        try {
            mIInputContext.beginBatchEdit();
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanclearMetaKeyStates(int states)

        try {
            mIInputContext.clearMetaKeyStates(states);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleancommitCompletion(android.view.inputmethod.CompletionInfo text)

        try {
            mIInputContext.commitCompletion(text);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleancommitCorrection(android.view.inputmethod.CorrectionInfo correctionInfo)

        try {
            mIInputContext.commitCorrection(correctionInfo);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleancommitText(java.lang.CharSequence text, int newCursorPosition)

        try {
            mIInputContext.commitText(text, newCursorPosition);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleandeleteSurroundingText(int beforeLength, int afterLength)

        try {
            mIInputContext.deleteSurroundingText(beforeLength, afterLength);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanendBatchEdit()

        try {
            mIInputContext.endBatchEdit();
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanfinishComposingText()

        try {
            mIInputContext.finishComposingText();
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public intgetCursorCapsMode(int reqModes)

        int value = 0;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getCursorCapsMode(reqModes, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mCursorCapsMode;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return 0;
        }
        return value;
    
public android.view.inputmethod.ExtractedTextgetExtractedText(android.view.inputmethod.ExtractedTextRequest request, int flags)

        ExtractedText value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getExtractedText(request, flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mExtractedText;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public java.lang.CharSequencegetSelectedText(int flags)

        CharSequence value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getSelectedText(flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mSelectedText;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public java.lang.CharSequencegetTextAfterCursor(int length, int flags)

        CharSequence value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getTextAfterCursor(length, flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mTextAfterCursor;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public java.lang.CharSequencegetTextBeforeCursor(int length, int flags)

        CharSequence value = null;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.getTextBeforeCursor(length, flags, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    value = callback.mTextBeforeCursor;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return null;
        }
        return value;
    
public booleanperformContextMenuAction(int id)

        try {
            mIInputContext.performContextMenuAction(id);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanperformEditorAction(int actionCode)

        try {
            mIInputContext.performEditorAction(actionCode);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanperformPrivateCommand(java.lang.String action, android.os.Bundle data)

        try {
            mIInputContext.performPrivateCommand(action, data);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanreportFullscreenMode(boolean enabled)

        try {
            mIInputContext.reportFullscreenMode(enabled);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleanrequestCursorUpdates(int cursorUpdateMode)

        boolean result = false;
        try {
            InputContextCallback callback = InputContextCallback.getInstance();
            mIInputContext.requestUpdateCursorAnchorInfo(cursorUpdateMode, callback.mSeq, callback);
            synchronized (callback) {
                callback.waitForResultLocked();
                if (callback.mHaveValue) {
                    result = callback.mRequestUpdateCursorAnchorInfoResult;
                }
            }
            callback.dispose();
        } catch (RemoteException e) {
            return false;
        }
        return result;
    
public booleansendKeyEvent(android.view.KeyEvent event)

        try {
            mIInputContext.sendKeyEvent(event);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleansetComposingRegion(int start, int end)

        try {
            mIInputContext.setComposingRegion(start, end);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleansetComposingText(java.lang.CharSequence text, int newCursorPosition)

        try {
            mIInputContext.setComposingText(text, newCursorPosition);
            return true;
        } catch (RemoteException e) {
            return false;
        }
    
public booleansetSelection(int start, int end)

        try {
            mIInputContext.setSelection(start, end);
            return true;
        } catch (RemoteException e) {
            return false;
        }