Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Issue 842493004: [Clank IME] Make keyCode detection sensitive to autocomplete=on|off. (Closed)

Created:
5 years, 11 months ago by huangs
Modified:
5 years, 11 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, suzhe
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Clank IME] Make keyCode detection sensitive to autocomplete=on|off. Fixing Stable blocker for Clank IME. The old keyCode detection heuristics would emit KEYCODE_DEL when the last character of composition is deleted by backspace. This causes the bug where the composition gets reset (Japanese keyboard). We fix the the problem by emitting keyCode 229 when composition is updated, if autocomplete=on. If autocomplete=off then we can can emit the keyCode, provided that we have single-character commits. Due to unfortunate collision with https://codereview.chromium.org/834133004 , we have to to define constant textInputFlagAutocompleteOff for compatibility with trunk and Beta. The companion WebKit CL is https://codereview.chromium.org/797243003/ BUG=422685 Committed: https://crrev.com/1a8a145d5ea8289f1e527c3de95f233e4a659cde Cr-Commit-Position: refs/heads/master@{#311245}

Patch Set 1 #

Patch Set 2 : Changing heuristic for English composition to work. #

Total comments: 1

Patch Set 3 : Implementing suzhe@'s suggested change to isolate single-character commits. #

Total comments: 7

Patch Set 4 : Remove unused variable. #

Patch Set 5 : Fix modifiers and directly check autocomplete instead. #

Total comments: 4

Patch Set 6 : Removing unneeded code. #

Total comments: 1

Patch Set 7 : Comment fix. #

Patch Set 8 : Differentiate single vs. multiple unknown character increase. #

Patch Set 9 : Changing approach on handling single charaters. #

Total comments: 2

Patch Set 10 : Fixing inverted comment. #

Patch Set 11 : Try to fix compile failure involving static variable. #

Patch Set 12 : Try @VisibleForTesting? #

Patch Set 13 : Add hack const to enable Beta merge. #

Patch Set 14 : Fixing comment. #

Patch Set 15 : Updating unittest. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -5 lines) Patch
M content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +14 lines, -3 lines 1 comment Download
M content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -2 lines 1 comment Download

Messages

Total messages: 59 (11 generated)
huangs
PTAL. Thanks!
5 years, 11 months ago (2015-01-08 00:48:02 UTC) #2
bcwhite
On 2015/01/08 00:48:02, huangs1 wrote: > PTAL. Thanks! Emitting a backspace when the user types ...
5 years, 11 months ago (2015-01-08 11:27:16 UTC) #3
huangs
Updated. Earlier we've discussed storing a state for Unicode composition. Turns out androidKeyEventForCharacter() returns NULL ...
5 years, 11 months ago (2015-01-09 07:05:18 UTC) #5
huangs
I also found ImeTest.java and testGuessedKeyCodeFromTyping(). How do I run the test? I don't see ...
5 years, 11 months ago (2015-01-09 13:50:42 UTC) #6
huangs
Ping!
5 years, 11 months ago (2015-01-09 17:54:55 UTC) #7
aurimas (slooooooooow)
On 2015/01/09 17:54:55, huangs1 wrote: > Ping! 1. Build content_shell_apk and content_shell_test_apk targets 2. Install ...
5 years, 11 months ago (2015-01-09 18:16:03 UTC) #8
aurimas (slooooooooow)
bcwhite wrote this code. Is he OK with it?
5 years, 11 months ago (2015-01-09 18:18:14 UTC) #9
bcwhite
https://chromiumcodereview.appspot.com/842493004/diff/20001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/842493004/diff/20001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode388 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:388: && androidKeyEventForCharacter(oldtext.charAt(oldtext.length() - 1)) != null) Have you tested ...
5 years, 11 months ago (2015-01-09 22:52:44 UTC) #10
huangs
Yes, I tested manually by installing on Nexus 7 (Kit Kat) and Nexus 5 (Lollipop). ...
5 years, 11 months ago (2015-01-09 23:33:02 UTC) #11
huangs
I had a long discussion with suzhe@ at this weekend, and am convinced to go ...
5 years, 11 months ago (2015-01-12 09:53:17 UTC) #12
James Su
https://chromiumcodereview.appspot.com/842493004/diff/40001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/842493004/diff/40001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode422 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:422: int modifiers = 0; This variable is not necessary, ...
5 years, 11 months ago (2015-01-12 11:08:02 UTC) #14
bcwhite
> Essentially, we should emit keyCode = 229 for all changes related to a > ...
5 years, 11 months ago (2015-01-12 15:51:39 UTC) #15
James Su
On 2015/01/12 15:51:39, bcwhite wrote: > > Essentially, we should emit keyCode = 229 for ...
5 years, 11 months ago (2015-01-12 16:47:03 UTC) #16
huangs
Updated, PTAL. https://chromiumcodereview.appspot.com/842493004/diff/40001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/842493004/diff/40001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode422 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:422: int modifiers = 0; On 2015/01/12 11:08:02, ...
5 years, 11 months ago (2015-01-12 18:45:48 UTC) #17
bcwhite
This seems too big a change. You should just need... if ((mTextInputFlag & sTextInputAutoCompleteOff) == ...
5 years, 11 months ago (2015-01-12 19:03:09 UTC) #18
bcwhite
> Using 229 for all changes related to a composition is a standard (Although it's ...
5 years, 11 months ago (2015-01-12 19:11:45 UTC) #19
bcwhite
https://chromiumcodereview.appspot.com/842493004/diff/100001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/842493004/diff/100001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode423 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:423: // If autocomplete off then use heuristic to compute ...
5 years, 11 months ago (2015-01-12 20:46:54 UTC) #21
huangs
Updated. Still testing. https://chromiumcodereview.appspot.com/842493004/diff/100001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/842493004/diff/100001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode423 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:423: // If autocomplete off then use ...
5 years, 11 months ago (2015-01-12 20:52:37 UTC) #22
bcwhite
LGTM One minor nit. Assuming all your manual tests show that this solves the problem ...
5 years, 11 months ago (2015-01-12 20:56:04 UTC) #23
huangs
Patch #8 crashes for the autocomplete=off case "a " => "a. " because keyCode = ...
5 years, 11 months ago (2015-01-12 23:30:32 UTC) #24
huangs
OWNER review to aurimas@, PTAL. Thanks!
5 years, 11 months ago (2015-01-12 23:38:37 UTC) #25
aurimas (slooooooooow)
https://codereview.chromium.org/842493004/diff/180001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://codereview.chromium.org/842493004/diff/180001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode443 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:443: // If autocomplete=off then always send compose events rather ...
5 years, 11 months ago (2015-01-12 23:43:26 UTC) #26
huangs
Updated comment. https://codereview.chromium.org/842493004/diff/180001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://codereview.chromium.org/842493004/diff/180001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode443 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:443: // If autocomplete=off then always send compose ...
5 years, 11 months ago (2015-01-12 23:48:01 UTC) #27
aurimas (slooooooooow)
lgtm
5 years, 11 months ago (2015-01-13 00:00:52 UTC) #28
huangs
Thanks! Doing more testings before submitting.
5 years, 11 months ago (2015-01-13 00:04:35 UTC) #29
huangs
A problem is that with composition=on, tapping on a special character yields keyCode=229 instead of ...
5 years, 11 months ago (2015-01-13 01:03:05 UTC) #30
bcwhite
LGTM What kind of special character? If it's a multi-word Unicode character then length()==2 and ...
5 years, 11 months ago (2015-01-13 01:15:15 UTC) #31
bcwhite
Or try this... if (... && (textStr.length() == 1 || (textStr.length() == 2 && (texStr.charAt(0) ...
5 years, 11 months ago (2015-01-13 01:24:36 UTC) #32
huangs
Eek, probably shouldn't do that, but I'll try it (for Science). Also running try jobs.
5 years, 11 months ago (2015-01-13 01:40:51 UTC) #33
huangs
Nope that didn't work; special symbols & emoji still appear as compositions. I don't think ...
5 years, 11 months ago (2015-01-13 01:55:53 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/842493004/200001
5 years, 11 months ago (2015-01-13 01:57:52 UTC) #36
huangs
There are some odd errors in try jobs: ../../content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:431: error: cannot find symbol if ((mTextInputFlags ...
5 years, 11 months ago (2015-01-13 02:11:09 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_arm64_dbg_recipe/builds/36724) android_chromium_gn_compile_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/32252) android_dbg_tests_recipe ...
5 years, 11 months ago (2015-01-13 02:16:21 UTC) #39
huangs
Just realized I had extremely bad luck, and sTextInputFlagAutocompleteOff just landed 8 hours ago in ...
5 years, 11 months ago (2015-01-13 04:20:46 UTC) #40
huangs
I meant, *the CL to remove sTextInputFlagAutocompleteOff* just landed 8 hours ago.
5 years, 11 months ago (2015-01-13 04:27:07 UTC) #41
huangs
Lucky patch set #13: define the constant ourselves, so we're robust for Beta merge as ...
5 years, 11 months ago (2015-01-13 04:43:25 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/842493004/280001
5 years, 11 months ago (2015-01-13 04:54:57 UTC) #44
James Su
On 2015/01/12 19:11:45, bcwhite wrote: > > Using 229 for all changes related to a ...
5 years, 11 months ago (2015-01-13 06:09:42 UTC) #45
James Su
I understand that it's an urgent fix. But after this fix, can you guys fix ...
5 years, 11 months ago (2015-01-13 06:28:31 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tests_recipe/builds/44567)
5 years, 11 months ago (2015-01-13 06:39:00 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/842493004/300001
5 years, 11 months ago (2015-01-13 08:30:42 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator/builds/48390)
5 years, 11 months ago (2015-01-13 08:39:37 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/842493004/300001
5 years, 11 months ago (2015-01-13 08:50:45 UTC) #54
commit-bot: I haz the power
Committed patchset #15 (id:300001)
5 years, 11 months ago (2015-01-13 09:27:47 UTC) #55
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/1a8a145d5ea8289f1e527c3de95f233e4a659cde Cr-Commit-Position: refs/heads/master@{#311245}
5 years, 11 months ago (2015-01-13 09:28:32 UTC) #56
bcwhite
https://chromiumcodereview.appspot.com/842493004/diff/300001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java (right): https://chromiumcodereview.appspot.com/842493004/diff/300001/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java#newcode443 content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java:443: // FIXME: Use WebTextInputFlags.AutocompleteOff. We need this hack to ...
5 years, 11 months ago (2015-01-13 15:32:08 UTC) #57
bcwhite
https://chromiumcodereview.appspot.com/842493004/diff/300001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java File content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java (right): https://chromiumcodereview.appspot.com/842493004/diff/300001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java#newcode713 content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java:713: assertEquals(COMPOSITION_KEY_CODE, mImeAdapter.mLastSyntheticKeyCode); You should still test for KEYCODE_H but ...
5 years, 11 months ago (2015-01-13 15:33:43 UTC) #58
huangs
5 years, 11 months ago (2015-01-13 16:49:29 UTC) #59
Message was sent while issue was closed.
Yes. Will do in a follow-up CL (trunk only) that also removes the hacky constant
I put in.

Powered by Google App Engine
This is Rietveld 408576698