Loading core/java/android/inputmethodservice/RemoteInputConnection.java +21 −3 Original line number Diff line number Diff line Loading @@ -108,7 +108,11 @@ final class RemoteInputConnection implements InputConnection { @Nullable @AnyThread public CharSequence getTextAfterCursor(@IntRange(from = 0) int length, int flags) { if (length < 0 || mCancellationGroup.isCanceled()) { if (length < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "length=" + length + " is invalid and always results in null result."); } if (mCancellationGroup.isCanceled()) { return null; } Loading @@ -132,7 +136,11 @@ final class RemoteInputConnection implements InputConnection { @Nullable @AnyThread public CharSequence getTextBeforeCursor(@IntRange(from = 0) int length, int flags) { if (length < 0 || mCancellationGroup.isCanceled()) { if (length < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "length=" + length + " is invalid and always results in null result."); } if (mCancellationGroup.isCanceled()) { return null; } Loading Loading @@ -185,7 +193,17 @@ final class RemoteInputConnection implements InputConnection { @AnyThread public SurroundingText getSurroundingText( @IntRange(from = 0) int beforeLength, @IntRange(from = 0) int afterLength, int flags) { if (beforeLength < 0 || afterLength < 0 || mCancellationGroup.isCanceled()) { if (beforeLength < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "beforeLength=" + beforeLength + " is invalid and always results in null result."); } if (afterLength < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "afterLength=" + afterLength + " is invalid and always results in null result."); } if (mCancellationGroup.isCanceled()) { return null; } Loading core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java +20 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,11 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { Log.w(TAG, "getTextAfterCursor on inactive InputConnection"); return null; } if (length < 0) { Log.i(TAG, "Returning null to getTextAfterCursor due to an invalid length=" + length); return null; } return ic.getTextAfterCursor(length, flags); }, useImeTracing() ? result -> buildGetTextAfterCursorProto(length, flags, result) : null); } Loading @@ -246,6 +251,11 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { Log.w(TAG, "getTextBeforeCursor on inactive InputConnection"); return null; } if (length < 0) { Log.i(TAG, "Returning null to getTextBeforeCursor due to an invalid length=" + length); return null; } return ic.getTextBeforeCursor(length, flags); }, useImeTracing() ? result -> buildGetTextBeforeCursorProto(length, flags, result) : null); } Loading Loading @@ -276,6 +286,16 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { Log.w(TAG, "getSurroundingText on inactive InputConnection"); return null; } if (beforeLength < 0) { Log.i(TAG, "Returning null to getSurroundingText due to an invalid" + " beforeLength=" + beforeLength); return null; } if (afterLength < 0) { Log.i(TAG, "Returning null to getSurroundingText due to an invalid" + " afterLength=" + afterLength); return null; } return ic.getSurroundingText(beforeLength, afterLength, flags); }, useImeTracing() ? result -> buildGetSurroundingTextProto( beforeLength, afterLength, flags, result) : null); Loading Loading
core/java/android/inputmethodservice/RemoteInputConnection.java +21 −3 Original line number Diff line number Diff line Loading @@ -108,7 +108,11 @@ final class RemoteInputConnection implements InputConnection { @Nullable @AnyThread public CharSequence getTextAfterCursor(@IntRange(from = 0) int length, int flags) { if (length < 0 || mCancellationGroup.isCanceled()) { if (length < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "length=" + length + " is invalid and always results in null result."); } if (mCancellationGroup.isCanceled()) { return null; } Loading @@ -132,7 +136,11 @@ final class RemoteInputConnection implements InputConnection { @Nullable @AnyThread public CharSequence getTextBeforeCursor(@IntRange(from = 0) int length, int flags) { if (length < 0 || mCancellationGroup.isCanceled()) { if (length < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "length=" + length + " is invalid and always results in null result."); } if (mCancellationGroup.isCanceled()) { return null; } Loading Loading @@ -185,7 +193,17 @@ final class RemoteInputConnection implements InputConnection { @AnyThread public SurroundingText getSurroundingText( @IntRange(from = 0) int beforeLength, @IntRange(from = 0) int afterLength, int flags) { if (beforeLength < 0 || afterLength < 0 || mCancellationGroup.isCanceled()) { if (beforeLength < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "beforeLength=" + beforeLength + " is invalid and always results in null result."); } if (afterLength < 0) { // TODO: Should we throw an InvalidParameterException() based on targetSdkVersion? Log.e(TAG, "afterLength=" + afterLength + " is invalid and always results in null result."); } if (mCancellationGroup.isCanceled()) { return null; } Loading
core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java +20 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,11 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { Log.w(TAG, "getTextAfterCursor on inactive InputConnection"); return null; } if (length < 0) { Log.i(TAG, "Returning null to getTextAfterCursor due to an invalid length=" + length); return null; } return ic.getTextAfterCursor(length, flags); }, useImeTracing() ? result -> buildGetTextAfterCursorProto(length, flags, result) : null); } Loading @@ -246,6 +251,11 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { Log.w(TAG, "getTextBeforeCursor on inactive InputConnection"); return null; } if (length < 0) { Log.i(TAG, "Returning null to getTextBeforeCursor due to an invalid length=" + length); return null; } return ic.getTextBeforeCursor(length, flags); }, useImeTracing() ? result -> buildGetTextBeforeCursorProto(length, flags, result) : null); } Loading Loading @@ -276,6 +286,16 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { Log.w(TAG, "getSurroundingText on inactive InputConnection"); return null; } if (beforeLength < 0) { Log.i(TAG, "Returning null to getSurroundingText due to an invalid" + " beforeLength=" + beforeLength); return null; } if (afterLength < 0) { Log.i(TAG, "Returning null to getSurroundingText due to an invalid" + " afterLength=" + afterLength); return null; } return ic.getSurroundingText(beforeLength, afterLength, flags); }, useImeTracing() ? result -> buildGetSurroundingTextProto( beforeLength, afterLength, flags, result) : null); Loading