New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 740140 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocked on:
issue 539536



Sign in to add a comment

typing sometimes fails on URL bar for Samsung keyboard

Project Member Reported by changwan@chromium.org, Jul 7 2017

Issue description

Originally reported as b/35863435.

Repro steps:

1. Turn off predictive text on Samsung keyboard.
2. Type google.com and go to google.com
3. Type goo
4. The second 'o' does not get typed.

4 out of 100 tries

Samsung did a bit more analysis and found that typing sometimes fails on URL bar because input gets restarted, with the following stack traces:

InputMethodManager.startInputInner(int, IBinder, int, int, int) line: 1612   
InputMethodManager.restartInput(View) line: 1587   
UrlBar(TextView).setText(CharSequence, TextView$BufferType, boolean, int) line: 4999   
UrlBar(TextView).setText(CharSequence, TextView$BufferType) line: 4936   
UrlBar(EditText).setText(CharSequence, TextView$BufferType) line: 111   
UrlBar.setText(CharSequence, TextView$BufferType) line: 865   
UrlBar(TextView).setText(CharSequence) line: 4911   
UrlBar.setUrl(String, String) line: 747   
UrlBar.setAutocompleteText(CharSequence, CharSequence) line: 779   
LocationBarPhone(LocationBarLayout).onSuggestionsReceived(List, String) line: 1985   
AutocompleteController.onSuggestionsReceived(List, String, long) line: 212   
SystemMessageHandler.nativeDoRunLoopOnce(long, long, long) line: not available [native method]   
SystemMessageHandler.handleMessage(Message) line: 41   
SystemMessageHandler(Handler).dispatchMessage(Message) line: 102   
Looper.loop() line: 154   
ActivityThread.main(String[]) line: 6776   
Method.invoke(Object, Object...) line: not available [native method]   
ZygoteInit$MethodAndArgsCaller.run() line: 1520   
ZygoteInit.main(String[]) line: 1410   

I can take a look.

 
Blockedon: 539536
This can be easily reproducible when there is a branch point.

1) Type google.com and type enter.
2) Type going and type enter.
3) Type goo.

Now you will see that 'ing' will be removed and that's when mDelegate.replaceAllTextFromAutocomplete() gets called.

And a glance at Android's TextView tells me that
creating a spannablestring and calling setText() causes imm.restartInput().

I tested it against the patch for the model (https://chromium-review.googlesource.com/c/543307),
and I could not reproduce this issue because it only calls removeSpan() and append() which do not restart input.

So this may be automatically fixed in case the patch lands without having to call setText().

Sign in to add a comment