Search in sources :

Example 26 with ExtractedText

use of android.view.inputmethod.ExtractedText in project android_frameworks_base by ResurrectionRemix.

the class InputConnectionWrapper method getExtractedText.

public ExtractedText getExtractedText(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;
}
Also used : RemoteException(android.os.RemoteException) ExtractedText(android.view.inputmethod.ExtractedText)

Example 27 with ExtractedText

use of android.view.inputmethod.ExtractedText in project android_frameworks_base by crdroidandroid.

the class InputConnectionWrapper method getExtractedText.

public ExtractedText getExtractedText(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;
}
Also used : RemoteException(android.os.RemoteException) ExtractedText(android.view.inputmethod.ExtractedText)

Aggregations

ExtractedText (android.view.inputmethod.ExtractedText)27 RemoteException (android.os.RemoteException)7 ExtractedTextRequest (android.view.inputmethod.ExtractedTextRequest)2 Pair (android.support.v4.util.Pair)1 Editable (android.text.Editable)1 SpannableString (android.text.SpannableString)1 SpannableStringBuilder (android.text.SpannableStringBuilder)1 KeyEvent (android.view.KeyEvent)1 EditorInfo (android.view.inputmethod.EditorInfo)1 InputConnection (android.view.inputmethod.InputConnection)1 SpacingAndPunctuations (com.android.inputmethod.latin.settings.SpacingAndPunctuations)1 TextRange (com.android.inputmethod.latin.utils.TextRange)1