Skip to content
Snippets Groups Projects
  • Jean Chalard's avatar
    6fbe83be
    [IL53] Fix a wrong test. · 6fbe83be
    Jean Chalard authored
    This test was intended only for cases without a selection, and as
    a safety net for cases where the app would pretend the cursor
    is at N but we can get P chars from the editor where P > N.
    
    When there is a selection, this is wrong. In the practice it works
    because these values are not used in this case, but it's still wrong.
    
    The case where P > N is arguable, but actually I see little reason
    to trust the getTextBeforeCursor() method more than the
    onUpdate selection method. Plus in the practice, I don't think
    we are aware of any app with this bug, and it's probably not a
    great idea to be too robust about this as it may encourage wrong
    values sent to onUpdateSelection.
    
    Change-Id: I42f2065d7aee668074e6b8e40b259da7e88e16e1
    6fbe83be
    History
    [IL53] Fix a wrong test.
    Jean Chalard authored
    This test was intended only for cases without a selection, and as
    a safety net for cases where the app would pretend the cursor
    is at N but we can get P chars from the editor where P > N.
    
    When there is a selection, this is wrong. In the practice it works
    because these values are not used in this case, but it's still wrong.
    
    The case where P > N is arguable, but actually I see little reason
    to trust the getTextBeforeCursor() method more than the
    onUpdate selection method. Plus in the practice, I don't think
    we are aware of any app with this bug, and it's probably not a
    great idea to be too robust about this as it may encourage wrong
    values sent to onUpdateSelection.
    
    Change-Id: I42f2065d7aee668074e6b8e40b259da7e88e16e1
RichInputConnection.java 38.86 KiB