Skip to content
Snippets Groups Projects
Commit 65bce4ca authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Never pass negative values to setSelection."

parents b08a9e02 f1974572
No related branches found
No related tags found
No related merge requests found
......@@ -483,12 +483,16 @@ public final class RichInputConnection {
*
* @param start the character index where the selection should start.
* @param end the character index where the selection should end.
* @return Returns true on success, false if the input connection is no longer valid either when
* setting the selection or when retrieving the text cache at that point.
* @return Returns true on success, false on failure: either the input connection is no longer
* valid when setting the selection or when retrieving the text cache at that point, or
* invalid arguments were passed.
*/
public boolean setSelection(final int start, final int end) {
if (DEBUG_BATCH_NESTING) checkBatchEdit();
if (DEBUG_PREVIOUS_TEXT) checkConsistencyForDebug();
if (start < 0 || end < 0) {
return false;
}
mExpectedSelStart = start;
mExpectedSelEnd = end;
if (null != mIC) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment