Commit Graph

4492 Commits (7ede642df417c0f732573f639970b138f0bee18c)

Author SHA1 Message Date
Tadashi G. Takaoka ad5795a891 Fix InputMethodInfo cache in RichInputMethodManager
Bug: 13271570
Change-Id: Ie06cd83baaaf674d8b34f0232c164c4541aceb43
2014-03-03 23:36:35 +09:00
Tadashi G. Takaoka 3f91acdc96 Add additional subtypes test
Change-Id: I2994fd72bc284c84757f5a2bfa8045aa574a8fbc
2014-03-03 17:16:02 +09:00
Keisuke Kuroyanagi e76c273502 Merge changes I20ce61c4,I2edab4e3
* changes:
  Remove "Use only personalization dictionary".
  Remove redundant creation of dictionary facilitator.
2014-03-03 04:00:24 +00:00
Keisuke Kuroyanagi 858045b41c Merge "Fix: wrong auto correction for whilelist and personalized words." 2014-02-28 12:26:03 +00:00
Keisuke Kuroyanagi 23ae574a11 Fix: wrong auto correction for whilelist and personalized words.
This happens when there are tailing single quotes.

Bug: 13237314
Change-Id: I7fd2a20b25ac2217f9621d7f2510345bbd633c14
2014-02-28 21:24:26 +09:00
Keisuke Kuroyanagi 5128935ac4 Add header attributes for evaluation.
Bug: 13197276
Change-Id: Ib5247da691ff24a73e13485288237ccc51bb54f0
2014-02-28 21:06:03 +09:00
Keisuke Kuroyanagi 58a536e41a Merge "Use dynamic operations to construct all ver4 dicts." 2014-02-28 09:37:23 +00:00
Keisuke Kuroyanagi 684f5f18b1 Merge "Added a method and run GC for testing." 2014-02-28 09:33:51 +00:00
Keisuke Kuroyanagi d302b98ce6 Added a method and run GC for testing.
Bug: 13231889
Change-Id: If64b7422967c3e4107c845072b64a7bb26a35f7e
2014-02-28 18:17:09 +09:00
Ken Wakasa 98534dc065 Add missing null checks for getOwnerInstance()
It may just return null.

Change-Id: I778fb48262ef8af28a4af50b70bb94ace75a488c
2014-02-28 16:13:51 +09:00
Keisuke Kuroyanagi ea89cb40b7 Use dynamic operations to construct all ver4 dicts.
Bug: 8187060
Bug: 13127350
Change-Id: I081ee904c41898128efa8ba7a1bf3fa0a46c6231
2014-02-27 23:21:09 +09:00
Keisuke Kuroyanagi 1aac28a2b9 Remove "Use only personalization dictionary".
Bug: 13216198
Change-Id: I20ce61c4a10c360e028bf6427f632cc5299763e4
2014-02-27 22:32:00 +09:00
Keisuke Kuroyanagi e9926b0d11 Remove redundant creation of dictionary facilitator.
Change-Id: I2edab4e3ba4ea0b9b13f9bb224aac86cac9b9f31
2014-02-27 22:31:57 +09:00
Jean Chalard 71e3ecd0a2 Fix a bug with auto-caps entries from personalization
Bug: 13215163
Change-Id: I00099cb4927c96de46e57e14ab906d41c9c2151a
2014-02-27 14:40:54 +09:00
Keisuke Kuroyanagi e1480a246d Merge "Set additional attributes in dictionary facilitator." 2014-02-26 10:37:46 +00:00
Keisuke Kuroyanagi f8552f61a4 Set additional attributes in dictionary facilitator.
Bug: 13197276
Change-Id: I206cf4e599ca9cdf40d669358a1067a2954d11e3
2014-02-26 19:14:16 +09:00
Keisuke Kuroyanagi e55d44c535 Merge "Add a method to create dict with additional attributes." 2014-02-26 10:07:53 +00:00
Keisuke Kuroyanagi 18f91cf617 Add a method to create dict with additional attributes.
Bug: 13197276
Change-Id: I80311a51d9e98bfeb8c0dd9cd4adde93af366d54
2014-02-26 19:03:27 +09:00
Keisuke Kuroyanagi 009bb5642b Merge "Use NOT_A_PROBABILITY for adding OOV words." 2014-02-26 09:48:57 +00:00
Jean Chalard 7e70e9dc49 Merge "[IL110] Remove an unused interface function" 2014-02-26 09:08:30 +00:00
Keisuke Kuroyanagi 2b27e06733 Merge "Read and write forgetting curve header attributes." 2014-02-26 09:06:56 +00:00
Keisuke Kuroyanagi 6112cc26a7 Read and write forgetting curve header attributes.
Bug: 13197276
Change-Id: I6c38a127e1745903594b7bf0ec80ef179e794feb
2014-02-26 18:04:12 +09:00
Keisuke Kuroyanagi 8559b403ed Use NOT_A_PROBABILITY for adding OOV words.
Bug: 13197276
Change-Id: I23f453c2c1deea70eab552f8d433fe264adf68b3
2014-02-26 17:50:44 +09:00
Jean Chalard bd1caac16a [IL110] Remove an unused interface function
...and make a method private.

Bug: 8636060
Change-Id: If16f7e8ef3779f77a9db23fb7c54e7c23b043b86
2014-02-26 17:46:20 +09:00
Jean Chalard 23e22613d7 Remove useless args and processing.
Bug: 13062385
Change-Id: I426545d1fe8fd76bcf4d1dce19e6b571a55c79ae
2014-02-26 11:40:43 +09:00
Jean Chalard 57c0c577af [QRP6] Fix: recorrection top candidate is displayed in bold
Bug: 10385162
Change-Id: Icf9471d474a3a8ed8f38c46c7948c66f9131691e
2014-02-25 19:48:09 +09:00
Jean Chalard 0c34ee20a8 [QRP5] Fix boldness for predictions, and small refactoring
This is more correct. When predictions, the typed word should
always be null unless explicitly passed. The text color should be
that of a valid typed word only if it's actually the typed word.

Bug: 13170509
Change-Id: I769ae100e112c37c6f02064fe9ef2f81372ca9e5
2014-02-25 19:44:57 +09:00
Jean Chalard 783f193239 [QRP4] Simplification & small correctness fix.
This fixes the color of the predictions when running
on a theme that has different colors for typed and
suggested words (GB theme).
Also, this is easier to understand and to modify from
now on.

Change-Id: Ifdc6d86a1695e83e16103041b06a2451f8d52cc4
2014-02-25 08:59:14 +00:00
Jean Chalard a0984662a1 [QRP3] Refactoring
Rename some variables for clarity and use constants
instead of immediates.

Change-Id: Ie07fbfcc3738ac4e67aefddc339fc54259172c39
2014-02-25 17:05:47 +09:00
Jean Chalard 74224f2c5c [QRP2] Small refactor
Bug: 13170509
Change-Id: Ib9f10b8a137fc773ab0e5dc903e577038e29a9e2
2014-02-25 17:05:47 +09:00
Jean Chalard ef3a45643e [QRP1] Fix a bug where the wrong value would get passed
In the practice it works because this never tries to access
inside the suggestion strip, and the worst that can happen
is a wrong text color for a suggestion. But since the two
colors that would be swapped are the same, nobody ever
notices -- unless they are using the GingerBread theme.

Change-Id: Ic8c70d8b3cdddf92946dfefbbc6d061572626c7a
2014-02-25 17:05:44 +09:00
Jean Chalard 6e224a236a Merge "Correctly read the header of APK-embedded dicts" 2014-02-24 13:57:46 +00:00
Jean Chalard 890b44e537 Correctly read the header of APK-embedded dicts
Bug: 13164518
Change-Id: I8768ad887af8b89ad9f29637f606c3c68629c7ca
2014-02-24 22:54:01 +09:00
Jean Chalard 64ace089a8 Merge "Use an executor to serialize opening dictionaries." 2014-02-24 13:43:49 +00:00
Tadashi G. Takaoka 2c55706b0e Merge "Create a utils class for executors." 2014-02-24 13:33:44 +00:00
Jean Chalard 4de2fcdde3 Use an executor to serialize opening dictionaries.
Bug: 13082957
Change-Id: I25570ab4da94337ed60330c0869fe47657096626
2014-02-24 21:05:24 +09:00
Jean Chalard b434acee34 Create a utils class for executors.
Preliminary refactoring to fix
Bug: 13082957

Change-Id: I9f1283c37089bc96140b774b1c559d58031de004
2014-02-24 20:52:49 +09:00
Jean Chalard f19745728e Never pass negative values to setSelection.
Bug: 13136079
Change-Id: Ieae6bafbd5339a033f0f342ba9af7dcc4ce209fa
2014-02-24 16:52:55 +09:00
Keisuke Kuroyanagi 2b72aa07a9 Disconnect app data search client after fetching all data.
Bug: 13138201
Change-Id: Ibaa3c2c22a4fe44ea23e92ce8576141bbad09b12
2014-02-24 14:47:54 +09:00
Jean Chalard 296adf5710 Merge "Change a heuristic and add a log." 2014-02-21 11:58:16 +00:00
Keisuke Kuroyanagi bb6b978a19 Merge "Fix: file descriptor leaking." 2014-02-21 11:37:09 +00:00
Jean Chalard bf075b21a1 Merge "Don't trim newer inputpointers with old data" 2014-02-21 11:19:04 +00:00
Keisuke Kuroyanagi ad508d029f Merge "Remove corrupted ver4 dictionaries." 2014-02-21 09:03:19 +00:00
Keisuke Kuroyanagi d24a99cff6 Fix: file descriptor leaking.
File descriptors will be closed in
BinaryDictionary.finalize(); but, this leads to unit test fails.

Bug: 13066902
Change-Id: I2b0d3e54ee91fa844530df54596f86bbbbac81a5
2014-02-21 17:25:34 +09:00
Jean Chalard 2a5ec00301 Don't trim newer inputpointers with old data
We already have a mechanism to avoid this crash, but it wasn't
used every time it needed to. It's possible that ending a batch
input and starting a batch input happen while suggestions
are being pulled out, which would result in pointers that have
been reset being passed for trimming.
Just increasing the sequence number should get rid of the
problem.

Bug: 12178124
Change-Id: I36ef3bc8a78679bc09daa39e665f5ce1bab50c2a
2014-02-21 16:43:11 +09:00
Tadashi G. Takaoka d73044a249 Add ImportantNoticeDialog
Change-Id: Icaeb7dddd16362cd4a6384d295f89c7fbabc8b35
2014-02-21 16:36:15 +09:00
Keisuke Kuroyanagi d934fb43ad Remove corrupted ver4 dictionaries.
Bug: 12916055
Change-Id: I2c390ab1dc483915691b47a605772cbc2dfeaf09
2014-02-21 15:09:37 +09:00
Tadashi G. Takaoka fe39d576dc Support versioned important notice
This change must be checked in together with If38a754d00.

Bug: 10587358
Change-Id: I91580f9468bc5ee7ed1694d7852a60dc6793dac0
2014-02-21 09:54:08 +09:00
Jean Chalard 3b4c1d3056 Change a heuristic and add a log.
The heuristic in RichInputConnection makes little sense
when textLength > mExpectedSelStart but we have
more than 1024 characters of text. If there are that many,
it's about 100% sure that 1024 is not the correct cursor
position. With no good guess, we'll just continue trusting
the app, even though we know it's lying : at least it will
make the problem visible to the app author.

Also, there have been a lot of confusion about initialSelStart
and initialSelEnd. The keyboard should log them so that
it helps us and editor authors debug more easily these
common problems.

Issue #65170 in AOSP and
Bug: 12772035
Change-Id: I6665a16c9f2832d33ee323f033bb38bcc092a3b4
2014-02-20 23:49:20 +09:00
Jean Chalard 1b3a142cac Merge "Fix a bug where suggestions would not be updated." 2014-02-20 14:46:35 +00:00
Jean Chalard 6f50c95887 Fix a bug where suggestions would not be updated.
Also fix a small cosmetic bug where the suggestion strip
would flash.

Bug: 12951777
Change-Id: I68b7bb9175571de9c718f737eebd9f67ea04a931
2014-02-20 23:32:04 +09:00
Jean Chalard a118d19f6c Merge "Don't distrust the cursor pos so much as to bug on IPC delay" 2014-02-20 14:22:48 +00:00
Jean Chalard 3c84eb8822 Don't distrust the cursor pos so much as to bug on IPC delay
When the cursor is moved by the user, the RichInputConnection
is told about it. However, to work around a framework bug, it
also looks at how many characters are in the buffer before the
cursor, and if that's more than the value it's been passed, it
deduces that's a framework bug and there are at least as many
characters as seen before the cursor, so it puts the expected
cursor position there.

When you move the cursor, TextView calls onUpdateSelection,
and when you move it fast, you'll get rapid-fire calls to
onUpdateSelection. This is fine, the RIC is equipped to
deal with that.

However, these calls take some time to make it to the IME. In
this instance, when the first call gets through and the IME
calls TextView (synchronously) for text before the cursor, the
cursor has already moved in the app, and TextView returns more
characters than the cursor position was declared to be in this
instance, so the RIC sets that as the expected cursor position.
Sure enough, a split second later, the second call to
onUpdateSelection arrives, with the new cursor position set
where the RIC had found it too early. The RIC takes that as an
"expected" cursor move, and the input does not get reset.

Luckily, we have a way out. As far as we know, the framework bug
only manifests itself upon rotation, which means we should only
have to adjust for it in onStartInputView. Doing it in
onUpdateSelection is too zealous (and probably too distrustful of
the app to send the correct cursor positions).

So we should just take care of the rotation case (by calling
tryFixLyingCursorPosition in onStartInputView) and remove the
compensating code in resetCachesUponCursorMoves.

Bug: 12982502
Change-Id: Ic3c1408a1ec45deaea63b01d98376a79ae567d77
2014-02-20 23:13:14 +09:00
Keisuke Kuroyanagi d36328cecf Add test only methods to test personalized dicts.
Bug: 11122480
Change-Id: I79a4a73ff09a2d34d4ca094d705e901fb4bc855c
2014-02-20 22:20:43 +09:00
Keisuke Kuroyanagi 485c1ec685 Merge "Add final and volatile for members of InputLogic." 2014-02-20 10:12:45 +00:00
Keisuke Kuroyanagi afdb6f011b Merge "Add user history dictionary decaying test." 2014-02-20 10:05:20 +00:00
Keisuke Kuroyanagi b063377e77 Add final and volatile for members of InputLogic.
Bug: 13107471
Change-Id: I47df79bc6f015c212d1b6d2f63b2efc5da24294e
2014-02-20 18:55:19 +09:00
Keisuke Kuroyanagi 0bc66daae3 Add user history dictionary decaying test.
Bug: 10667710

Change-Id: Ib2be57d8c4cbbb34f64555d84ea6fd571cfdd247
2014-02-20 18:36:46 +09:00
Keisuke Kuroyanagi a514ea7e1b Merge "Check all enabled IME's subtypes to enable personalization." 2014-02-20 09:33:21 +00:00
Keisuke Kuroyanagi d10e2d85af Merge "Throw IOException when dict header cannot be read." 2014-02-20 09:33:08 +00:00
Keisuke Kuroyanagi afd9b62f00 Throw IOException when dict header cannot be read.
Bug: 13106638
Change-Id: Ib48ef0a191a436552c49b6e817dfa13fe1567ae8
2014-02-20 18:11:17 +09:00
Jean Chalard 475f9f35b6 Merge "Comments improvements" 2014-02-20 08:22:39 +00:00
Tadashi G. Takaoka 1672ccbbb6 Change important notice version preference file
This CL also reset the notice version to 1.
This CL must be checked in together with Iea8d9ff038.

Change-Id: I838f7b5b295388d64d6aba90f50b06654eba16e5
2014-02-20 16:50:34 +09:00
Tadashi G. Takaoka 78db739cdb Fix build due to Ib4c472756f
Change-Id: I27aad91d3f821b5c0d6a3c6405b4a9d03c5bd814
2014-02-20 16:16:57 +09:00
Jean Chalard ad2cf220a9 Merge "Remove a call to a deprecated method" 2014-02-20 06:40:46 +00:00
Tadashi G. Takaoka 251ed3b358 Merge "Revert "Turn off personalization default settings"" 2014-02-20 06:26:48 +00:00
Tadashi G. Takaoka c2ba73ab41 Revert "Turn off personalization default settings"
This reverts commit 0a4ac795d6.

Bug: 10587358
Change-Id: Ib4c472756fb9a6ebba4a66d34a9652f1b5afc714
2014-02-20 06:06:29 +00:00
Keisuke Kuroyanagi 6b23749dec Check all enabled IME's subtypes to enable personalization.
Bug: 13067743

Change-Id: I6fc68b5151430a5ab51777f4c381e20f5a657924
2014-02-20 15:05:37 +09:00
Jean Chalard c44b7312ad Remove a call to a deprecated method
...that would cause a crash

Bug: 13082186
Change-Id: Ie12575c27dfdd2029bc9d5f0647e444f69770afc
2014-02-20 14:40:38 +09:00
Jean Chalard be8ad77ebb Comments improvements
Typo fixes and clarifications

Change-Id: I0f7e0b6e665232bb995172fff10521c7f17599eb
2014-02-20 13:29:43 +09:00
Keisuke Kuroyanagi 34fb962513 Call PersonalizationDictionarySessionRegistrar.init().
Wrongly removed in I1f50cb137b6054dc9.

Bug: 13067743
Change-Id: I27cd221cb7f6e403c3fc128d65d14dbf628b6f55
2014-02-19 23:27:14 +09:00
Keisuke Kuroyanagi d102eb80da Remove personalization dicts for multilingual users.
Bug: 13067743
Change-Id: I1f50cb137b6054dc9442237586b70fc0aa2bf427
2014-02-19 21:00:27 +09:00
Tadashi G. Takaoka 920c40fe45 Use AlertDialog.setOnDismissListener
AlertDialog.Builder.setOnDismissListener is supported from API 17.

Bug: 10587358
Change-Id: Ie8ce8e283b803f7f6bb58ced446e676339f980eb
2014-02-19 19:05:06 +09:00
Tadashi G. Takaoka ed616083dd Merge "Turn personalization on when important notice dialog is displayed" 2014-02-19 09:46:15 +00:00
Tadashi G. Takaoka 6abc852255 Turn personalization on when important notice dialog is displayed
This change must be checked in together with Ifde70b1d3b.

Bug: 10587358
Change-Id: I9dc48f9d521e0e6f6269e4f184389ba805f3053f
2014-02-19 18:36:32 +09:00
Tadashi G. Takaoka 3a7ed5fdfe Merge "Fix IllegalStateException raied by monkey" 2014-02-19 08:27:37 +00:00
Tadashi G. Takaoka 9fd7447d6c Fix IllegalStateException raied by monkey
Bug: 13082467
Change-Id: I9290974821d22067e7ddd60dce441b11ca533a0f
2014-02-19 16:40:52 +09:00
Keisuke Kuroyanagi 03105290d8 Merge "Throw exception when the header cannot be read." 2014-02-19 04:59:47 +00:00
Tadashi G. Takaoka 776bba098b Merge "Turn off personalization default settings" 2014-02-19 04:25:04 +00:00
Keisuke Kuroyanagi 97a40d030f Throw exception when the header cannot be read.
Bug: 13066902
Change-Id: I8fd0f361a4ca55aaab8a2bd2e11f48f92b87fc93
2014-02-19 12:35:58 +09:00
Keisuke Kuroyanagi e49e007bb2 Fix: Use old suggest after reloading.
Change-Id: Icb2821f61c4203254b7d573cad5ce71fbf0ed841
2014-02-19 12:34:09 +09:00
Tadashi G. Takaoka 0a4ac795d6 Turn off personalization default settings
Because the previous personalization settings default value was on,
this CL changes the preference key of the personalization settings.

Bug: 10587358
Change-Id: I80233e8af4b532d8c67d8fb184c2865862bb35dd
2014-02-19 12:08:50 +09:00
Jean Chalard 80d413caff Merge "Straighten out database cursors behavior." 2014-02-18 11:09:38 +00:00
Jean Chalard 28e0b24965 Merge "Fix a bug where the cache would be out of sync" 2014-02-18 10:58:50 +00:00
Jean Chalard b8ff8ca9d9 Straighten out database cursors behavior.
Some were never closed, other closed twice. This change
makes all Cursor instances behave, having the #close()
call in a finally{} clause, and puts the burden of closing
the cursor squarely on the creator rather than in the
called methods.
There is however one exception that is beyond the scope
of this change: UserDictionarySettings have a Cursor
member, it's never closed, and fixing the problem is not
obvious. This change adds a TODO for now.

It's not very clear if this change actually helps with
bug#12670151, but it may be related and it's a good
think to do anyway.

Bug: 12670151
Change-Id: I87cc44387e7dee3da1488671b93a28d9d73f7dc0
2014-02-18 19:58:23 +09:00
Jean Chalard fe92c174ea Fix a bug where the cache would be out of sync
During recorrection, the cursor position when calling
commitText is not necessarily at the end of the
composing text.
Besides, RichInputConnection assumes the cursor is
always after any composing text. This is not correct,
but in the practice, it seems all code paths work.
We should fix this in the future.

Bug: 13060691
Change-Id: I15f71fff62d36e80cf6e4a022c5e78af634b199d
2014-02-18 19:55:54 +09:00
Jean Chalard 783dabb812 Merge "Cleanup." 2014-02-18 09:54:33 +00:00
Jean Chalard 63be066544 Cleanup.
Less code, less chance of stuff escaping, and a bit of a clarification.
Yay.

Change-Id: I3193fd8ad7ac28195260cbc231c4e498a63a460c
2014-02-18 17:07:46 +09:00
Ken Wakasa 12ff7da19d Some cosmetic fixes in LatinIME.java
Change-Id: Ia2d04ab992f5a0cc736150b2691b2f8ae8f0955d
2014-02-18 14:56:50 +09:00
Ken Wakasa 0d32643e69 Merge "Cosmetic fixes" 2014-02-18 03:28:04 +00:00
Ken Wakasa 2312c1954f Cosmetic fixes
Change-Id: I6c755565ba7689357d02d26cc0e92a93031953e8
2014-02-18 12:17:24 +09:00
Tadashi G. Takaoka cc05f468ca Merge "Refactor InputAttributes a bit" 2014-02-18 02:25:46 +00:00
Tadashi G. Takaoka 06fbfc4951 Refactor InputAttributes a bit
Change-Id: I43d65be6de64ba86f83e8528a138e20c4fa1e3ed
2014-02-18 11:11:36 +09:00
Tadashi G. Takaoka affdd36423 Set neutral suggestions should be called after load settings
Bug: 13058751
Change-Id: Iba49e86b90d595473d91753827d499e551dad45c
2014-02-18 11:04:00 +09:00
Tadashi G. Takaoka f0f4e9fc16 Update important notice version even when user select Settings
Bug: 13060852
Change-Id: I463fdf3d51cacf99693fcde2998ea751046d1cc5
2014-02-18 00:14:30 +09:00
Jean Chalard 782c9fee6b Merge "Don't resume suggestion on links." 2014-02-17 11:46:54 +00:00
Jean Chalard 7a7aeffcdc Don't resume suggestion on links.
Bug: 11447084
Change-Id: I5bd558b9dd85d1505aa918f44e8ac3e52ec42d97
2014-02-17 20:36:16 +09:00
Tadashi G. Takaoka 5cd732f8c5 Stop overriding InputView.dispatchTouchEvent
Bug: 11721001
Bug: 11976254
Change-Id: I950f13ec4084da7fd9c1c25fd7abed1e5d31ed4c
2014-02-17 19:51:47 +09:00
Tadashi G. Takaoka 891e4860f8 Merge "Stop overriding SuggestionStripView.dispatchTouchEvent" 2014-02-17 09:20:54 +00:00
Tadashi G. Takaoka e32548f32d Stop overriding SuggestionStripView.dispatchTouchEvent
Bug: 11721001
Bug: 11976254
Change-Id: Idfdeafe45abb16ca54be529b4f4b2c38c22a7fac
2014-02-17 18:11:10 +09:00