Skip to content

Commit f1a9455

Browse files
committed
Fix enter key to search not working in Google Play Store
Also fix enter key to search crashing Aurora Store. --- Need to apply EditorInfo.IME_MASK_ACTION to convert the full IME options bits to just the actions bits. Otherwise a bad value is passed to inputConnection.performEditorAction.
1 parent 75a1c43 commit f1a9455

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
## [Unreleased]
55

6+
- Fixed enter key to search not working in Google Play Store / crashing Aurora Store
7+
68

79
## [v1.2.8] (61) 過海 (2023-12-03)
810

app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2021--2023 Conway
2+
Copyright 2021--2024 Conway
33
Licensed under the GNU General Public License v3.0 (GPL-3.0-only).
44
This is free software with NO WARRANTY etc. etc.,
55
see LICENSE or <https://www.gnu.org/licenses/>.
@@ -151,6 +151,7 @@ public class StrokeInputService
151151
private final List<Integer> phraseCompletionFirstCodePointList = new ArrayList<>();
152152

153153
private int inputOptionsBits;
154+
private int inputActionsBits;
154155
private boolean enterKeyHasAction;
155156
private boolean inputIsPassword;
156157

@@ -367,6 +368,7 @@ public void onStartInput(final EditorInfo editorInfo, final boolean isRestarting
367368
super.onStartInput(editorInfo, isRestarting);
368369

369370
inputOptionsBits = editorInfo.imeOptions;
371+
inputActionsBits = inputOptionsBits & EditorInfo.IME_MASK_ACTION;
370372
enterKeyHasAction = (inputOptionsBits & EditorInfo.IME_FLAG_NO_ENTER_ACTION) == 0;
371373

372374
final int inputTypeBits = editorInfo.inputType;
@@ -423,7 +425,7 @@ public void onStartInputView(final EditorInfo editorInfo, final boolean isRestar
423425
private void setEnterKeyDisplayText()
424426
{
425427
String enterKeyDisplayText = null;
426-
switch (inputOptionsBits & EditorInfo.IME_MASK_ACTION)
428+
switch (inputActionsBits)
427429
{
428430
case EditorInfo.IME_ACTION_DONE:
429431
enterKeyDisplayText = getString(R.string.display_text__done);
@@ -626,7 +628,7 @@ private void effectEnterKey(final InputConnection inputConnection)
626628
}
627629
else if (enterKeyHasAction)
628630
{
629-
inputConnection.performEditorAction(inputOptionsBits);
631+
inputConnection.performEditorAction(inputActionsBits);
630632
}
631633
else
632634
{

0 commit comments

Comments
 (0)