GET_EXTRACTED_TEXT_MONITOR flag not respected
Reported by
bhal...@amazon.com,
Dec 13 2016
|
||||
Issue descriptionDevice 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
,
Dec 21 2016
,
Jan 3 2017
,
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.
,
Feb 16 2017
Note this bug was filed for patch https://codereview.chromium.org/2500663002/
,
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.
,
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.
,
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
,
May 10 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by rsgav...@chromium.org
, Dec 14 2016Owner: changwan@chromium.org
Status: Assigned (was: Unconfirmed)