Skip to content
Snippets Groups Projects
  1. Jun 27, 2014
  2. Jun 25, 2014
  3. Jun 06, 2014
    • Jean Chalard's avatar
      Fix a bug on rotation with selection. · 9fd9a68d
      Jean Chalard authored
      The symptom : when text is selected and the device is rotated,
      sometimes the keyboard sets the word as being composed around
      the start of the selection. Upon the next rotation this ends up
      with the keyboard committing some text in place of the selection.
      
      The cause : another bug in the framework with rotation >.>
      The keyboard receives a call to startInput with a wrong cursor
      position, namely one that does not represent a selection. The
      keyboard sets a composition according to this wrong data. When
      the keyboard is rotated again, it commits the text, which takes
      the place of the selection.
      
      The solution : actually when restarting input the keyboard
      realizes that the cursor position is wrong. We cancel composition
      at that time.
      For robustness, this change also implements two other defensive
      changes : upon call to onUpdateSelection, we actually realize
      that the previous values were wrong, so we also fix it at that
      time, and in addition, when rotating, we finishComposingText()
      instead of commitText() which is less dangerous. Implementing
      this later change also allows us to let less internal variables
      from InputLogic escape to LatinIME, so it's also a good change
      for design.
      
      Bug: 14140799
      
      Change-Id: Ib10de18e53e376ac1bbc8487e13d969828483346
      9fd9a68d
  4. May 30, 2014
  5. May 29, 2014
  6. May 23, 2014
  7. May 21, 2014
  8. Mar 20, 2014
  9. Mar 10, 2014
  10. Feb 24, 2014
  11. Feb 20, 2014
    • Jean Chalard's avatar
      Change a heuristic and add a log. · 3b4c1d30
      Jean Chalard authored
      The heuristic in RichInputConnection makes little sense
      when textLength > mExpectedSelStart but we have
      more than 1024 characters of text. If there are that many,
      it's about 100% sure that 1024 is not the correct cursor
      position. With no good guess, we'll just continue trusting
      the app, even though we know it's lying : at least it will
      make the problem visible to the app author.
      
      Also, there have been a lot of confusion about initialSelStart
      and initialSelEnd. The keyboard should log them so that
      it helps us and editor authors debug more easily these
      common problems.
      
      Issue #65170 in AOSP and
      Bug: 12772035
      Change-Id: I6665a16c9f2832d33ee323f033bb38bcc092a3b4
      3b4c1d30
    • Jean Chalard's avatar
      Don't distrust the cursor pos so much as to bug on IPC delay · 3c84eb88
      Jean Chalard authored
      When the cursor is moved by the user, the RichInputConnection
      is told about it. However, to work around a framework bug, it
      also looks at how many characters are in the buffer before the
      cursor, and if that's more than the value it's been passed, it
      deduces that's a framework bug and there are at least as many
      characters as seen before the cursor, so it puts the expected
      cursor position there.
      
      When you move the cursor, TextView calls onUpdateSelection,
      and when you move it fast, you'll get rapid-fire calls to
      onUpdateSelection. This is fine, the RIC is equipped to
      deal with that.
      
      However, these calls take some time to make it to the IME. In
      this instance, when the first call gets through and the IME
      calls TextView (synchronously) for text before the cursor, the
      cursor has already moved in the app, and TextView returns more
      characters than the cursor position was declared to be in this
      instance, so the RIC sets that as the expected cursor position.
      Sure enough, a split second later, the second call to
      onUpdateSelection arrives, with the new cursor position set
      where the RIC had found it too early. The RIC takes that as an
      "expected" cursor move, and the input does not get reset.
      
      Luckily, we have a way out. As far as we know, the framework bug
      only manifests itself upon rotation, which means we should only
      have to adjust for it in onStartInputView. Doing it in
      onUpdateSelection is too zealous (and probably too distrustful of
      the app to send the correct cursor positions).
      
      So we should just take care of the rotation case (by calling
      tryFixLyingCursorPosition in onStartInputView) and remove the
      compensating code in resetCachesUponCursorMoves.
      
      Bug: 12982502
      Change-Id: Ic3c1408a1ec45deaea63b01d98376a79ae567d77
      3c84eb88
    • Jean Chalard's avatar
      Comments improvements · be8ad77e
      Jean Chalard authored
      Typo fixes and clarifications
      
      Change-Id: I0f7e0b6e665232bb995172fff10521c7f17599eb
      be8ad77e
  12. Feb 18, 2014
    • Jean Chalard's avatar
      Fix a bug where the cache would be out of sync · fe92c174
      Jean Chalard authored
      During recorrection, the cursor position when calling
      commitText is not necessarily at the end of the
      composing text.
      Besides, RichInputConnection assumes the cursor is
      always after any composing text. This is not correct,
      but in the practice, it seems all code paths work.
      We should fix this in the future.
      
      Bug: 13060691
      Change-Id: I15f71fff62d36e80cf6e4a022c5e78af634b199d
      fe92c174
  13. Feb 17, 2014
  14. Jan 27, 2014
  15. Jan 20, 2014
  16. Jan 17, 2014
  17. Jan 10, 2014
    • Jean Chalard's avatar
      [IL54] Add a mirror method to fix the cursor pos estimate · ecf46df2
      Jean Chalard authored
      This just mirrors what InputLogic#tryFixLyingCursorPosition
      is doing. That method will go away in the next change.
      
      Change-Id: Ifa2827dbc1f1d20e2c642d6f2d23514a01ed9203
      ecf46df2
    • Jean Chalard's avatar
      [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
  18. Jan 09, 2014
  19. Jan 08, 2014
    • Jean Chalard's avatar
      Fix a race condition, take 2. · e5cdcaff
      Jean Chalard authored
      Don't use absolute cursor positions when making edits,
      this leads to race conditions.
      This is a bit ugly and will need to be fixed soon. Plans are
      underway to clean this up.
      
      Bug: 12390573
      Change-Id: I69c09fc41b979880d0800c55a710e39373287cff
      e5cdcaff
    • Jean Chalard's avatar
      Revert "Fix a race condition, take 2." · a247264d
      Jean Chalard authored
      Conflicts prevent this to be cherry-picked.
      
      This reverts commit dd3d697a.
      
      Change-Id: Ib97fae2234633b4bb27d611f48a79060db9ab16f
      a247264d
    • Jean Chalard's avatar
      Fix a race condition, take 2. · dd3d697a
      Jean Chalard authored
      Don't use absolute cursor positions when making edits,
      this leads to race conditions.
      This is a bit ugly and will need to be fixed soon. Plans are
      underway to clean this up.
      
      Bug: 12390573
      Change-Id: Ib42d4149343c642b1b5c1937b424e8afdbd4cc1f
      dd3d697a
  20. Dec 27, 2013
    • Jean Chalard's avatar
      [IL52] Remove a useless method. · 1e50c681
      Jean Chalard authored
      This old method doesn't even re-read the old suggestions. It used to
      recompute them without the coordinates.
      Re-using the recorrection code, which is much more advanced, is
      the right thing to do here.
      
      Also, refining the test. It's no use trying to resume suggestion
      if we don't have a suggestion strip, since we aren't going to
      auto-correct anything anyway.
      
      Not the motivation for this change, but this also fixes
      Bug: 11620256
      Change-Id: Id49efa32e293c49837c61fdc752c86bbac1d2c88
      1e50c681
  21. Dec 13, 2013
    • Ken Wakasa's avatar
      Reset to 9bd6dac4 · 2fa3693c
      Ken Wakasa authored
      The bulk merge from -bayo to klp-dev should not have been merged to master.
      
      Change-Id: I527a03a76f5247e4939a672f27c314dc11cbb854
      2fa3693c
  22. Nov 28, 2013
    • Jean Chalard's avatar
      Fix getNthPreviousWord. · da459787
      Jean Chalard authored
      This should take into accounts word connectors.
      
      Change-Id: Ic7fa5c837cd65a43ba43d7ae9d299b8d20019892
      da459787
  23. Nov 27, 2013
  24. Nov 25, 2013
  25. Nov 16, 2013
  26. Nov 14, 2013
  27. Nov 13, 2013
    • Jean Chalard's avatar
      Fix many small nits. · 3a9b2430
      Jean Chalard authored
      ...the interaction of which results in a very bad bug.
      
      Bug: 11648854
      Change-Id: I774489e384388f187e72b9ac091ab387c5e1a79a
      3a9b2430
    • Jean Chalard's avatar
      Fix many small nits. · 5a0bc6ac
      Jean Chalard authored
      ...the interaction of which results in a very bad bug.
      
      Bug: 11648854
      Change-Id: I774489e384388f187e72b9ac091ab387c5e1a79a
      5a0bc6ac
  28. Nov 07, 2013
  29. Oct 22, 2013
    • Jean Chalard's avatar
      Stopgap solution for a crash. · 8a167537
      Jean Chalard authored
      This returns the wrong string, but since it's used for getting the
      previous word for bigrams, it only results in slightly worse
      suggestions quality.
      
      Bug: 11273655
      Change-Id: I6ce5de2f76effc453ca691a654ab6bf17445b9e7
      8a167537
Loading