Skip to content

Commit

Permalink
Update android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemK…
Browse files Browse the repository at this point in the history
…eyboard.java

Co-authored-by: Marc Durdin <[email protected]>
  • Loading branch information
darcywong00 and mcdurdin authored May 20, 2024
1 parent 099b563 commit 9e0207a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public void onStartInput(EditorInfo attribute, boolean restarting) {
InputConnection ic = getCurrentInputConnection();
if (ic != null) {
ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0);
/*
We do sometimes receive null `icText.text`, even though
getExtractedText() docs does not list this as a possible
return value, so we test for that as well (#11479)
*/
if (icText != null && icText.text != null) {
boolean didUpdateText = KMManager.updateText(KeyboardType.KEYBOARD_TYPE_SYSTEM, icText.text.toString());
boolean didUpdateSelection = KMManager.updateSelectionRange(KeyboardType.KEYBOARD_TYPE_SYSTEM);
Expand Down

0 comments on commit 9e0207a

Please sign in to comment.