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

Issue 673819 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: ----



Sign in to add a comment

GET_EXTRACTED_TEXT_MONITOR flag not respected

Reported by bhal...@amazon.com, Dec 13 2016

Issue description

Device name: Amazon FireOS Devices

From "Settings > About Chrome" 
Application version: Any 57.0.x
Operating system: Any 

URLs (if applicable): N/A

Description:
While Invocation of
org.chromium.content.browser.input.InputMethodManagerWrapper#updateSelection
from the org.chromium.content.browser.input.ImeAdapter#updateSelection
the Chromium does not invoke the required Android API  
required as part of the guidelines given in 

https://developer.android.com/reference/android/view/inputmethod/InputConnection.html
#getExtractedText(android.view.inputmethod.ExtractedTextRequest, int)

which recommend that if the GET_EXTRACTED_TEXT_MONITOR flag is set,
you should be calling updateExtractedText(View, int, ExtractedText)
whenever you call updateSelection(View, int, int, int, int).

This change did not affect existing Standard Input Method Managers such as the
Android Default Keyboard registered to the platform 
because they split the screen and focus the text field while editing it through 
the GoogleKeyboard or Similar IME
but this specifically affects External Input Method apps 
which can obscure the entire screen.

Without this change, the keyboards which obscure the ContentView completely
will not receive text updates from the ContentView and not be able to 
display the current state of the Text Fields while editing it
and thus making for a expected better User experience.

Steps to reproduce:
1. Build a Keyboard interface on the Android Platform Side (e.g. FireOS)
which obscures the entire view of the screen when focussed.
2. Open Chrome and attempt to edit text on the ContentView.

Expected:
The updates from the successful commit of text in the 
ContenView are intercepted and relayed back to the 
External InputMethodManager

Actual:
The updates from the successful commit of text in the 
ContenView are not intercepted/received by the
External InputMethodManager

 
Components: UI>Input>Text>IME
Owner: changwan@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: aelias@chromium.org yabinh@chromium.org
Summary: GET_EXTRACTED_TEXT_MONITOR flag not respected (was: ContentView not relaying Text Field Updates to External InputMethodManager.)

Comment 4 by aelias@chromium.org, Feb 16 2017

Can you point out a keyboard app (or mode within such keyboard app) available on stock Android which makes use of getExtractedText()?  Chromium doesn't necessarily have a commitment to supporting every legacy feature of InputConnection, in fact we might prefer to continue ignoring those that have zero use (e.g. we don't not support most of the subclasses of text Spannables).  Also, if there is no manual test target, it makes it difficult to determine if whether or not have caused a regression in the code you're adding, therefore such code is also somewhat unmaintainable.

Comment 5 by aelias@chromium.org, Feb 16 2017

Note this bug was filed for patch https://codereview.chromium.org/2500663002/

Comment 6 by bhal...@amazon.com, Apr 26 2017

Hi aelias@,
As we support a variant of the Chromium Browser, the Silk Browser on the Amazon FireOS platform; this change is geared toward consumption on the Amazon FireOS which is based on AOSP rather than Stock Android.

Furthermore FireOS does in fact use the legacy features of InputConnection which is why this change helps us support this particular use case.

Also we plan to have sufficient automated test coverage to detect regressions on the legacy InputConnection feature to help maintain the feature until it is deprecated or reaches End of Life.

Comment 7 by aelias@chromium.org, Apr 27 2017

Hmm, looks like we universally pass in IME_FLAG_NO_EXTRACT_UI flag to IME.  It means this is unlikely to be called, but the documentation doesn't specify this amounts to a contract that getExtractedText won't be called by IME, either.

So there is a (debatable) technical compliance reason to add this, but also, looking more closely at it, the support burden doesn't look too high and it does provide a nicely asynchronous way for IME to obtain text which we may prefer to encourage over the blocking synchronous getters.  So I guess we can take this, I added code review comments.
Project Member

Comment 8 by bugdroid1@chromium.org, May 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b5ebac3230f3c90782296ae95396e7f512729bc

commit 9b5ebac3230f3c90782296ae95396e7f512729bc
Author: bhallam <bhallam@amazon.com>
Date: Wed May 10 05:42:09 2017

Relay Text Field Updates from ContentView to External InputMethodManager.

This change surfaces up all ExtractedText updates from the content view
back to the InputMethodManager.

Is is applicable to allow consumers of the Android InputManager
to receive text change events back.

This change does not affect Standard Input Method Managers such as the
Android Default Keyboard registered to the platform but specifically
affects External Input Method apps like virtual floating keyboard
implementations or screen keyboard overlay implementations.

In addition this change is consistent with the guidelines given as part of
https://developer.android.com/reference/android/view/inputmethod/InputConnection.html
States that if the GET_EXTRACTED_TEXT_MONITOR flag is set,
you should be calling updateExtractedText(View, int, ExtractedText)
whenever you call updateSelection(View, int, int, int, int).

BUG= 673819 
TEST=New ContentShellJunitTests, Existing ContentShell Instrumentation Tests.

Review-Url: https://codereview.chromium.org/2500663002
Cr-Commit-Position: refs/heads/master@{#470488}

[modify] https://crrev.com/9b5ebac3230f3c90782296ae95396e7f512729bc/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
[modify] https://crrev.com/9b5ebac3230f3c90782296ae95396e7f512729bc/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapper.java
[modify] https://crrev.com/9b5ebac3230f3c90782296ae95396e7f512729bc/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java
[modify] https://crrev.com/9b5ebac3230f3c90782296ae95396e7f512729bc/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java

Comment 9 by aelias@chromium.org, May 10 2017

Status: Fixed (was: Assigned)

Sign in to add a comment