Commit Graph

793 Commits (65e93e352f64c412211df39484366755a44fa5d0)

Author SHA1 Message Date
Ken Wakasa 660776e09b Small performance improvement by removing interface accesses.
Change-Id: I6d91f3b086470b79306dbe2874db9748b9e0eb5f
2012-03-17 01:53:51 +09:00
Jean Chalard c68d1bbfaf Move the UserUnigramDictionary functionality over
UserBigramDictionary now assumes both functionalities. It will
be renamed to UserHistoryDictionary in a future change.

There are several reasons to do this. First, there is a lot of
duplicate code in User{Unigram,Bigram}Dictionaries that are
factored by the few lines of code in this change. Also, other
dictionaries like BinaryDictionary or ContactsDictionary all
assume both responsibilities, as should be the case
theoretically.

It is also possible to do this because previous versions don't
write any unigram data that we'd want to reuse. For even older
versions that do write data, we can't really make any sense out
of it. Bigram data however can be useful, and this allows us to
reuse it easily.

Change-Id: I755525f92744e1536eaef097527e8151b7859a30
2012-03-16 17:01:57 +09:00
Jean Chalard c24f66e180 Streamline some user history dictionary code
A lot of things don't really make sense in the old code.
Let's streamline it for now so that we have a cleaner interface
to work with. This is preliminary work for bug 4192129.

Change-Id: If01a5974cfadc43afced610c57fcf7fde67c1346
2012-03-16 12:22:39 +09:00
Jean Chalard 3fe263fac6 Extract an annoying method call
Change-Id: I78f22bb38222fea54a55e460fcf728bf941d15e9
2012-03-15 19:30:15 +09:00
Jean Chalard 6ec1209a33 Fix a bug where quotes and dashes are considered letters
Bug: 6174065
Change-Id: I702760d44ead0eeb60d06360aa3bb03c2ec73325
2012-03-15 18:18:52 +09:00
Jean Chalard 2be7a37acf Small cleanup
Exit-fast, update comment, make a method private

Change-Id: Id103bf03aeef43a1a4d064ecabb819490dc5d39a
2012-03-15 15:54:25 +09:00
Jean Chalard 03a3517075 Add info for obsolete suggestions in SuggestedWords
Change-Id: I9684c7b08244b34853ce8a99b6e9d885389f6687
2012-03-15 13:12:08 +09:00
Jean Chalard f985efe39c Remove a useless parameter
Change-Id: I03005240238fb004c20b2df0d836796e2e8b307f
2012-03-14 18:12:12 +09:00
Jean Chalard bdf6d1b18b Remove a useless method
Change-Id: I208dd2e725e37c2fb3cd51fe48194679e5912f6b
2012-03-14 15:59:04 +09:00
Jean Chalard 7d55c891af Make the Builder private
Change-Id: I2184084f4b7729c4324f8291d548bd4c4c2872a1
2012-03-14 15:42:14 +09:00
Jean Chalard 5b0643f50d Re-sequence the last calls to build()
Change-Id: If77ee5aa9483d3ca03c52812f31665dee6468e99
2012-03-14 14:19:24 +09:00
Jean Chalard 88bf1ba526 Move up the static methods of the Builder
Change-Id: Ic3e07b745b7b24cae0f772ea49e0de615b44caf9
2012-03-14 13:10:22 +09:00
Jean Chalard 8e19b1183e Kill the last place where the Builder was being used
I had missed that one

Change-Id: I9a5040a7a61e294396aa424de96a69dbb15f037a
2012-03-14 13:10:12 +09:00
Jean Chalard e3afb7d192 Make the Builder fully immutable at last
Change-Id: Ie399ca7a9e76ccab44a92bc378d11f92392fed2c
2012-03-13 20:33:13 +09:00
Jean Chalard ec471c72f8 Add to SuggestedWords a missing parameter, and use it.
Also stop using Builder between its creation and the call to
the #build() method.

Change-Id: Ie1fc3ec7b6f4c7c3789f672f4e26b4bf58c3e062
2012-03-13 20:19:21 +09:00
Jean Chalard 2e2519ee91 Make still more members of the Builder final.
Change-Id: Ic455f97247da5e40d4939555ab639ecffef36e2d
2012-03-13 20:05:00 +09:00
Jean Chalard b5eeb724fc Make some more Builder attributes final.
Change-Id: I3132b7fe4ee97c566736bfc21c3783cfc79fc7ff
2012-03-13 19:53:38 +09:00
Jean Chalard c60fea852d Make the suggested word list final in Builder.
Change-Id: I2ddfab00dc8c141fc989a051f16eb2b3571b7e86
2012-03-13 19:37:17 +09:00
Jean Chalard 674ffcdf93 Make an add into a set.
This method now only sets words, so it should be named set.
The functionality is identical since there are no more places
where the list is reused.
This will also allow to make the list final in an upcoming change.

Change-Id: I25b0c7d7f13c3fa5d89806f01f48f1026769603f
2012-03-13 19:07:42 +09:00
Jean Chalard 4ee186920e Remove a method that causes annoying side-effects.
...and replace by a call to a central method.

Change-Id: I93d0a2c2e99963a5b69923d1062d0e01853216b6
2012-03-13 18:22:49 +09:00
Jean Chalard d0d4074392 Remove a useless parameter.
Change-Id: I7625bf17158c207ad7e8cd496bef825704173c4c
2012-03-13 15:34:06 +09:00
Tadashi G. Takaoka 4c0c638a18 Use Animator to draw language name on spacebar
Note that Animator class exists in framework only on Honeycomb or
later.

Change-Id: Ie3392dbf8acc1547ebb2d16e04086c911d961aed
2012-03-13 14:25:57 +09:00
Jean Chalard 1dfef0336d Make a method static
Change-Id: Ie1d460562d38105abe91ae2da17cafd49e2cd394
2012-03-12 15:00:36 +09:00
Ken Wakasa c1ca8815f5 Fix an obvious bug in handleLanguageSwitchKey()
bug: 5759092

Change-Id: I8c7b2ef024cbab399d96f6b3ec553da4e9d2fb18
2012-03-11 00:44:47 +09:00
Jean Chalard 68823ae08e Make the safety net memory private
Change-Id: I10959d47c980d2e8f2ea995955acf02193e3ff7b
2012-03-09 22:01:15 +09:00
Jean Chalard d5f618e90a Remove a useless test
If we are not composing a word here, we have already returned

Change-Id: I63281abace777e3658286d4df6781d2cd5a29c33
2012-03-09 20:53:45 +09:00
Jean Chalard c5d2bb786e Don't use an intermediate object with a different meaning
Change-Id: Ie89916b49c852a51385ffd61cb596a58f23a46a0
2012-03-09 20:51:33 +09:00
Jean Chalard ed9986824e Move some auto-correction logic to where it belongs
Change-Id: I897c5ec3a630a4a6bfc593906df4d3fc7b244482
2012-03-09 20:45:37 +09:00
Jean Chalard dfd4abe818 Fix a shameful bug
I must have been sleeping when I wrote that

Change-Id: I887180ab610785a2000636adeeed99230b3c5390
2012-03-09 19:31:35 +09:00
Jean Chalard 0cf422fbb7 Reduction, step 8
Change-Id: I54334039597e235e24f169e34c1d44109180ee88
2012-03-09 19:00:29 +09:00
Jean Chalard a333ff19ef Reduction, step 7
Change-Id: I177ef2f29c8b6000c5e3d021c016c5d216fe3fc6
2012-03-09 18:59:20 +09:00
Jean Chalard a3ee019331 Reduction, step 6
Change-Id: I22ad4cea0e0cac23813da7e788f5c94974ce0ebf
2012-03-09 18:58:01 +09:00
Jean Chalard de165aed2a Separate bigram prediction from suggestion process
Change-Id: Ibdef206fbd6688a45cebbd7fb8a9f6cd175d03b0
2012-03-09 18:38:20 +09:00
Jean Chalard 6f722c8301 Remove useless stuff
Change-Id: I462d24da2d26661990d6aab2a13fde851763fd61
2012-03-09 18:36:52 +09:00
Jean Chalard 67af2a2415 Export some more logic out of Latin IME
Change-Id: Ib264533a05e9e09347bf254789e6ab5beec92400
2012-03-09 18:36:49 +09:00
Jean Chalard df9fce5df1 Export some logic out of LatinIME
Hopefully that will end in Suggest/SuggestedWords being autonomous
and won't need the logic spoon-fed to them

Change-Id: I915661bce13c69c8a5b8e5d4a8c41e18fea594cf
2012-03-09 18:36:45 +09:00
Jean Chalard 91e55ac000 Small optimization
We only use some of those results in one branch of an if() test.
Let's not compute those that are not needed.

Change-Id: I6ca068646b86d2980fb88e75b110ad077362c4ff
2012-03-09 16:47:43 +09:00
Jean Chalard 195419b1ec Small reorganization
...resulting in a slight optimization

Change-Id: I83a9b8c92c3d93ce75988285997ec138b3ffe52e
2012-03-09 16:41:35 +09:00
Jean Chalard 838629aea0 Remove useless test
typedWord may not be null here

Change-Id: I9e7afb89fafbf6fcbc91fbc132aecc06aec8979f
2012-03-09 15:52:23 +09:00
Jean Chalard 5a7cb9305a Merge "Remove a provably useless test (B4)" 2012-03-08 22:22:20 -08:00
Jean Chalard 31a5da28e3 Merge "Move some code around (B1)" 2012-03-08 21:15:25 -08:00
Jean Chalard 8cd847c2fa Remove a provably useless test (B4)
If !mInputAttributes.mInputTypeNoAutoCorrect then mCorrectionMode
will not have allowed #hasAutoCorrection() to return true.

Change-Id: I1b498d5aeb26194c765cc9b9dcb24d980de43894
2012-03-09 12:56:48 +09:00
Jean Chalard dc5dfe37e0 Move some code around (B1)
The goal is to make the creation of the Builder closer to
the #build() call

Change-Id: I48d76d4efdc180479829016582edd9de47e7332c
2012-03-09 12:33:23 +09:00
Jean Chalard 13fb8fb775 Limit escape of parameters
Change-Id: I3a7ab069042d5542ab2e033d1eeb13d718cd7698
2012-03-09 12:30:23 +09:00
Jean Chalard 21af2f40c5 Merge broadcast receivers again
It's probably simpler not to have registers dance around,
and just message the feedback manager when the audio event
happens.

Change-Id: Id0710ed102d10d01f1af93ad8cb660653bb3a9f8
2012-03-09 11:00:23 +09:00
Jean Chalard 7b77c683d7 Fix a crash
Bug: 6137076
Change-Id: I05f9f72a2678d10d3400dab5fc71544276739dcf
2012-03-09 10:29:51 +09:00
Tadashi G. Takaoka f686211183 Merge "Split Utils class to StringUtils, SubtypeUtils, and JniUtils" 2012-03-08 03:59:59 -08:00
Tadashi G. Takaoka cc8c8b99bd Split Utils class to StringUtils, SubtypeUtils, and JniUtils
Change-Id: I09e91675fe7d573dad8c933ad513b21d7e409144
2012-03-08 20:30:38 +09:00
Jean Chalard 0f1efae262 Merge "Cleanup unused imports (A7)" 2012-03-08 02:32:48 -08:00
Jean Chalard 663aabca0c Merge "Get the view for haptic feedback as a parameter (A6)" 2012-03-08 02:32:39 -08:00
Jean Chalard 7cfae83434 Merge "Export audio and haptic feedback to a specialized class. (A1)" 2012-03-08 02:31:45 -08:00
Jean Chalard 8667bbeab3 Small rename
Left/Right is wrong terminology here

Change-Id: I58c55849e45d9984dd3fb7b75a64e07667c9eba4
2012-03-08 18:49:38 +09:00
Jean Chalard 41a2929282 Cleanup unused imports (A7)
Change-Id: I48ba12e4311cbf2982ee8f5312b279bc8c1fdfe8
2012-03-08 18:37:03 +09:00
Jean Chalard 544c3c2952 Get the view for haptic feedback as a parameter (A6)
It's rather annoying (and possibly dangerous) to keep this as a member.
Get it from outside.

Change-Id: I00c42db96395fb65204fb140aeedc82bf312a86e
2012-03-08 18:37:00 +09:00
Jean Chalard 564496bad6 Export audio and haptic feedback to a specialized class. (A1)
Change-Id: I957d883d1ccf188cb98eb11031aa0a32fce4ed76
2012-03-08 18:35:20 +09:00
Jean Chalard f8b39f39cd Merge "Remove a useless class (B4)" 2012-03-08 01:14:33 -08:00
Jean Chalard 4b656a3fef Merge "Remove stuff that's not used any more (B3)" 2012-03-08 01:13:06 -08:00
Jean Chalard d8447ec353 Merge "Use the simple auto-correction status (B2)" 2012-03-08 01:12:46 -08:00
Jean Chalard fbe767cec5 Merge "Remember auto-correction status simply (B1)" 2012-03-08 00:54:30 -08:00
Tadashi G. Takaoka c648b88779 Merge "Dynamically determine key preview backing view height" 2012-03-07 04:17:52 -08:00
Tadashi G. Takaoka c8b0e5797e Dynamically determine key preview backing view height
Bug: 6023947
Change-Id: I53a5c0eb99100a0dfe3e025808f5dc55747d1287
2012-03-07 20:33:17 +09:00
Jean Chalard dab392c6f4 Merge "Fix a bug with successive manual picks" 2012-03-07 01:51:59 -08:00
Jean Chalard 3dd4bcb283 Merge "Recompute suggestions on language change." 2012-03-07 01:35:12 -08:00
Jean Chalard b84ee82e66 Recompute suggestions on language change.
Bug: 6106407
Change-Id: I43d9c89610a9ed7a9f6825bd90334d7b343df52c
2012-03-07 17:35:32 +09:00
Jean Chalard 845b24d9d3 Fix a bug with successive manual picks
Bug: 6121571
Change-Id: Ib16fbef1087da3b7da5539901ec57156f242f089
2012-03-07 17:32:42 +09:00
Jean Chalard f773ef19e8 Remove a useless class (B4)
\o/

Bug: 5975068
Change-Id: Ia18b55af6d555e7ee7af1cdd7c6227fc1ee6786b
2012-03-07 15:34:15 +09:00
Jean Chalard a0beebf711 Remove stuff that's not used any more (B3)
Change-Id: Ie86675ff2facd37430051bf129ddd930fb933dc9
2012-03-07 15:32:55 +09:00
Jean Chalard 0a59ac2ba8 Use the simple auto-correction status (B2)
Change-Id: I9d2f053b6f7bad20fc6afe5f5086a965e5014a5c
2012-03-07 15:31:22 +09:00
Jean Chalard 70852c91dc Remember auto-correction status simply (B1)
This duplicates the functionality in ComposingStateManager at
a fraction of the cost. It's not used yet.

Change-Id: Ica2607fb2f7c41e11189fcb566e253db8f62596f
2012-03-07 15:20:01 +09:00
Tadashi G. Takaoka 65fe7f7994 Merge "Add language switch key only to the phone layouts" 2012-03-06 18:19:45 -08:00
Tadashi G. Takaoka 81d4e3cd66 Add language switch key only to the phone layouts
Bug: 5759092
Change-Id: Ic7d7d4812976654c0e85fecabd1128eadfc52c5c
2012-03-07 10:03:21 +09:00
Jean Chalard 89ffb212b4 Make the keyboardswitcher and the subtypeswitcher final.
Change-Id: Ifcc79357adcc53f93b190b6e98d5569f42f74655
2012-03-06 19:07:21 +09:00
Jean Chalard 3cd1a00eca Resolve a todo
This exports some voiceproxy complexity to voiceproxy rather
than keeping it in latinime

Change-Id: I0b3523e77af4104cc3ed28417956059c734c8bfe
2012-03-06 18:43:18 +09:00
satok 231ef8fa3e Merge "Integrate the logic to calculate the proximities" 2012-03-05 23:25:29 -08:00
satok ca7ec2097c Integrate the logic to calculate the proximities
Bug: 4343280

Change-Id: I0f6a7e6912ed4abea07c10d266da4c7ccb0dae76
2012-03-06 15:34:27 +09:00
Jean Chalard 00ed3be95c Correct special space handling of punctuation
This fixes two defects:
- One where some separators should promote a phantom space to
a real space. This bug had a unit test but wasn't tracked.
- One where French punctuations would behave incorrectly. Tracked
Bug: 6113693

Change-Id: Ia7f86fc960e00141757632ab2c9bce9168dd6966
2012-03-06 14:00:34 +09:00
Tadashi G. Takaoka e79b1a8312 Make SuggestedWords immutable completely
Change-Id: I1b0f7b857e89307c987187c1969a2846aa97fdcc
2012-03-05 23:06:37 +09:00
Tadashi G. Takaoka 8cc8f26adf Make SuggestedWords partially immutable
Change-Id: I72a2f71d7f6565a30c06e563b0a64f496542cde9
2012-03-05 22:11:13 +09:00
Tadashi Takaoka d5b6360549 Merge "Revert "Make SuggestedWords immutable"" 2012-03-05 02:57:00 -08:00
Tadashi Takaoka d62fa834c6 Revert "Make SuggestedWords immutable"
This reverts commit c208f4dfb7
2012-03-05 02:54:21 -08:00
Jean Chalard 6a830277df Merge "Refactoring" 2012-03-05 01:49:46 -08:00
Jean Chalard 611a5bdf65 Refactoring
Change-Id: I2f92c01fa1ff6b318128d387f26942b5d47de3e0
2012-03-05 18:36:51 +09:00
Tadashi G. Takaoka c208f4dfb7 Make SuggestedWords immutable
Change-Id: I26bd82aee5ead84e40abfc3db5a48ed6d1e42361
2012-03-05 17:24:30 +09:00
Jean Chalard 895b70b8af Move some treatment to a more sensical place.
It makes more sense to catch words with the safety net in
updateSuggestions() than in showSuggestions(). Also, it's useless
to do it in updateBigramPredictions, because the result will
always be provably false.
This will also help with writing unit tests.

Change-Id: Ifab81e6c5a74b1aa75cf85ef7742fee69a98f5ce
2012-03-05 14:27:49 +09:00
Jean Chalard 9b01890254 Move a method to a more sensical place.
Change-Id: I11f87448f689cf828bff960ad7a3e4739a3457dc
2012-03-05 14:19:35 +09:00
Jean Chalard 428178aca6 Merge "Replace a useless computation with a constant" 2012-03-04 19:35:11 -08:00
Jean Chalard 4ab5486bf2 Merge "Remove a useless test" 2012-03-04 19:35:02 -08:00
Jean Chalard 4e112d0782 Replace a useless computation with a constant
This is provably always false

Change-Id: I88d783fa59fec0b7a729558ba974a6a58c158645
2012-03-05 11:57:36 +09:00
Jean Chalard a04d2358c0 Remove a useless test
With the current logic, this test provably always resolves
to false.

Change-Id: Iba84ef5f3a14cd8ac48c6a813519ab283bf605f8
2012-03-05 11:38:45 +09:00
Tadashi G. Takaoka 49079df8ec Merge "Omit InputMethodManagerCompatWrapper argument from some utility methods" 2012-03-04 18:12:47 -08:00
Tadashi G. Takaoka 2d25ba2750 Omit InputMethodManagerCompatWrapper argument from some utility methods
Change-Id: Ic837018c702c8c575de3e5e81fe8e31fee16fe22
2012-03-05 10:43:12 +09:00
Jean Chalard a83a53ba24 Some renaming
Change-Id: I445277cb3af469a0145a8da0ffb801b7e19048cd
2012-03-02 20:46:54 +09:00
Jean Chalard dd931c47be Some more simplification
I wish "are we autocorrecting?" was not computed in a dozen
places all depending on a hundred code paths
More than likely, this fixes very subtle discrepancies
between auto-correction indicator with the underline and with
the LED on the spacebar - which is not displayed any more in
the current version anyway. Especially, the LED probably
would have been off when the word was caught by the safety net.

Change-Id: Idda3021771081d6155b06915e728ecd64d9e042e
2012-03-02 20:34:10 +09:00
Jean Chalard e2a50bd804 Optimization
Avoid doing some useless processing.

Change-Id: I4ce0a188e10db30322bd25751dc5c09492cea301
2012-03-02 20:26:51 +09:00
Jean Chalard 7204eab3da Precompute two values that never change
Change-Id: Ic54e7926028ea8374564da5e5004d710f42c53e1
2012-03-02 20:04:42 +09:00
Jean Chalard 38e535e596 Change a parameter type to make a call clearer
Change-Id: I2918d0a8b00da743689b919f80128bbf36973f24
2012-03-02 20:01:34 +09:00
Jean Chalard 5bc2b61274 Move a method up a level
Change-Id: I6b9a697480127e4745698ab19f8a360b86ff39ca
2012-03-02 19:59:55 +09:00
Jean Chalard d02783cb63 Break out a method
Change-Id: Ia14fc320422b7f198c33ba522bb93dd70fbcb2c1
2012-03-02 19:52:06 +09:00
Jean Chalard d992fa847d Small refactor (A1)
Change-Id: Ia0838bbce47a2b60067f464685ad6d55ee4ec934
2012-03-02 18:55:04 +09:00
Jean Chalard fa12acb8b7 Change a dangerous ID
The message id 0 is used intrinsically by the framework
for all messages without a specific ID. Using 0 here
we can't reliably use the post(Runnable) method on our
handler, because these would in *some* respects be taken
for update_suggestion messages, but not all.
For example, they'd be removed on removeMessage() but
they would not trigger the actual process. This would
lead to utter confusion.

Change-Id: I5d9b01d38e2ff090cd0d80c27421dc8a41c317b8
2012-03-01 19:05:51 +09:00