Commit Graph

1801 Commits (26d97b089d0a4af751407775ac1a3f2ee82c16dd)

Author SHA1 Message Date
Jean Chalard 8abd15b59f Reduction, step 2
Change-Id: I06e117df43d25dbaf9fc7a7366efd9355a6215ce
2012-03-09 18:44:10 +09:00
Jean Chalard f08f30176b Reduction, step 1
Change-Id: Ic3ed04300cfd4c0b69b93b27379aca4093b32f67
2012-03-09 18:38:44 +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 d48b76267a Merge "Remove a useless test (B7)" 2012-03-08 22:26:20 -08:00
Jean Chalard 2d82757fc6 Merge "Rename a parameter (B6)" 2012-03-08 22:23:33 -08:00
Jean Chalard de19ab878d Merge "Remove useless tests (B5)" 2012-03-08 22:22:56 -08:00
Jean Chalard 5a7cb9305a Merge "Remove a provably useless test (B4)" 2012-03-08 22:22:20 -08:00
Jean Chalard 54392438c5 Merge "Optimize and clean up (B2)" 2012-03-08 22:00:02 -08:00
Jean Chalard 90bd4efd10 Remove a useless test (B7)
consideredWord is provably never null.

Change-Id: Ifaa0d2471c46f14967e70ad004d2b82f841a4566
2012-03-09 14:55:46 +09:00
Jean Chalard cf8bc92ba0 Rename a parameter (B6)
This is not necessarily the typed word. Actually, the parameter
that's passed here has trailing single quotes culled out of it.

Change-Id: Ia2038faa2cbbd3a5b8263e6c0fb5b8e670993fe9
2012-03-09 14:52:35 +09:00
Jean Chalard 92146f2926 Remove useless tests (B5)
WordComposer#getTypedWord() may not return null. Don't test for it.

Change-Id: I6aff14892503d0c275a3328c404ed99d2f40a687
2012-03-09 14:52:04 +09: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 94b20c90d8 Optimize and clean up (B2)
Stop parameters from escaping and don't do useless work and
simplify the code.
Yay.

Change-Id: I0dfc3e14b1cb50e0730f6d9c1d52b54516baa90e
2012-03-09 12:51:55 +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 23a5e9d1a7 Merge "Make AutoCorrection static and non-instantiable (A5)" 2012-03-08 19:05:30 -08:00
Jean Chalard 2621fe2256 Merge "Move a memory in the container class (A4)" 2012-03-08 19:04:56 -08:00
Jean Chalard 427dfe37ec Merge "Remove an unused method" 2012-03-08 18:31:26 -08:00
Jean Chalard cbbfa15765 Merge "Make AutoCorrection a step closer to being static (A3)" 2012-03-08 18:30:19 -08:00
Jean Chalard 58722d83f0 Merge "Stop uselessly remembering a value (A2)" 2012-03-08 18:30:10 -08:00
Jean Chalard caae6df0ce Remove an unused method
Who would have guessed this wasn't being called at all.

Change-Id: Ib74a212356ea44e9bf149619ed5464c14684a1ba
2012-03-09 11:10:55 +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
Jean Chalard 39286f98bc Merge "Remove useless stuff (A1)" 2012-03-08 04:02:46 -08:00
Tadashi G. Takaoka f686211183 Merge "Split Utils class to StringUtils, SubtypeUtils, and JniUtils" 2012-03-08 03:59:59 -08:00
Jean Chalard 82adfdaeae Make AutoCorrection static and non-instantiable (A5)
This needs change Ic6756baa to not break the build

Change-Id: I1c772dd99d63fec5d3ad67a0eb7fbc28ec7a0f0f
2012-03-08 20:56:59 +09:00
Jean Chalard 7a580a4769 Move a memory in the container class (A4)
This allows us to make AutoCorrection a purely static class.

Change-Id: I15b81bd7f3d6ea487154a5b09a81bc323be82ce1
2012-03-08 20:56:11 +09:00
Jean Chalard 9254dbcd7e Make AutoCorrection a step closer to being static (A3)
Change-Id: Ide3d9785661a672af9bc8dc0cf91cab816dd6caa
2012-03-08 20:55:49 +09:00
Jean Chalard 719f92fc77 Stop uselessly remembering a value (A2)
The value is only used in debug mode, and it can be recomputed
at the time.
This change does not impact the logic. There is however a side
effect: in debug mode, the normalized score will be displayed
also when the word comes out of the whitelist or is a valid word.
It's actually a good thing.

The end purpose is to make all methods in AutoCorrection static.

Change-Id: I1642b1fdfa6ae62b8aa2fed94a8a26ff4a7e4d0e
2012-03-08 20:55:37 +09:00
Jean Chalard ec0fca8a8b Remove useless stuff (A1)
Remove an unused method and avoid doing a useless computation

Change-Id: I29593c2e93f15857249b35bdd72ca28045056302
2012-03-08 20:55:25 +09:00
Tadashi G. Takaoka cc8c8b99bd Split Utils class to StringUtils, SubtypeUtils, and JniUtils
Change-Id: I09e91675fe7d573dad8c933ad513b21d7e409144
2012-03-08 20:30:38 +09:00
Tadashi G. Takaoka b43f2aeb69 Merge "Fix centering more suggestions panel on tablet" 2012-03-08 03:24:07 -08:00
Jean Chalard 2b1280c0f0 Merge "Return a value for tests instead of saving it" 2012-03-08 03:10:18 -08:00
Jean Chalard 32c181bfe0 Return a value for tests instead of saving it
Change-Id: I54fa32b92e89d03a53866bd1c0ee65955dd6b3d3
2012-03-08 20:07:54 +09:00
Jean Chalard 2bb29c4674 Simplification
Change-Id: Ibced83da2398f1e9ab6a0d6a22c2ad7c8f25cb7b
2012-03-08 19:50:47 +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 85e88d30c1 Merge "Remove a useless member (A5)" 2012-03-08 02:32:25 -08:00
Jean Chalard 60705c9ed3 Merge "Simplification of sound settings (A4)" 2012-03-08 02:32:16 -08:00
Jean Chalard d2b5ea2084 Merge "Make a condition positive (A3)" 2012-03-08 02:32:07 -08:00
Jean Chalard d749fb86ab Merge "Simplify audio management (A2)" 2012-03-08 02:31:57 -08:00
Jean Chalard 7cfae83434 Merge "Export audio and haptic feedback to a specialized class. (A1)" 2012-03-08 02:31:45 -08:00
Tadashi G. Takaoka bcbaffd9dd Fix centering more suggestions panel on tablet
Bug: 6129726
Change-Id: I8dac3251eec68ad3fb523c632ff39f3cc661c81f
2012-03-08 19:02:22 +09: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 29d967fdcb Remove a useless member (A5)
Change-Id: Ibaaeb8dbcb012f5e973e27ed9928401515656e9e
2012-03-08 18:36:56 +09:00
Jean Chalard bdbb22bb33 Simplification of sound settings (A4)
Change-Id: I0c6e207bae1e08c45a95b3479e1d67228d696792
2012-03-08 18:36:43 +09:00
Jean Chalard 2651b17fc4 Make a condition positive (A3)
mSoundOn is much easier to understand than mSilentModeOn

Change-Id: Ie51c5c75fcad62e13e0fb578a266af80f15dc440
2012-03-08 18:36:19 +09:00
Jean Chalard 793791cdf0 Simplify audio management (A2)
There is little point in deferring loading for this. Getting the
service at startup time is not very expensive anyway, plus we
can avoid getting it in a later change if sound is off in settings.

Change-Id: I08d65467f245fa2f9f617eb23257c327b3115673
2012-03-08 18:35:48 +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 3e2d385810 Restart LatinIME service when keyboard theme is changed
Bug: 6023947
Change-Id: I779da32708fca7333aff74929cc98173246ee685
2012-03-08 15:08:16 +09: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 691f1c174b Fix coordinates sent to native code
Change-Id: I2c8b093b59ad36ffe860c3c4d360d87251d101c4
2012-03-06 16:38:00 +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 611ec69413 Remove a useless method
Change-Id: I2002662ee07af2fcc626a52ea4e9ad8977b29ca2
2012-03-05 12:46: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 c2136c4e63 Merge "Some renaming" 2012-03-04 17:26:22 -08:00
Jean Chalard a157249014 Merge "Remove a useless method" 2012-03-02 05:57:48 -08:00
Jean Chalard e53840d216 Merge "Some more simplification" 2012-03-02 05:56:58 -08:00
Tadashi G. Takaoka 3a1844c33b Merge "Support dividers in MoreKeysKeyboard" 2012-03-02 03:58:13 -08:00
Tadashi G. Takaoka 5ef4fccbb9 Support dividers in MoreKeysKeyboard
Bug: 6080806
Change-Id: Iacd78c6aab6abf948717d34da7489a79c41316d2
2012-03-02 20:52:25 +09:00
Jean Chalard a83a53ba24 Some renaming
Change-Id: I445277cb3af469a0145a8da0ffb801b7e19048cd
2012-03-02 20:46:54 +09:00
Jean Chalard 5edda4111e Remove a useless method
Change-Id: I038e6a82b6463a2a8ec494171a596d76fbc75fe1
2012-03-02 20:38:41 +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 5a2c19d4fb Merge "Revert "Make a member read-only"" 2012-03-02 02:49:42 -08:00
Jean Chalard f1967ce322 Revert "Make a member read-only"
This reverts commit 6a43e39bf0
2012-03-02 02:49:24 -08:00
Jean Chalard 9727aea418 Merge "Small refactor (A1)" 2012-03-02 02:47:42 -08:00
Jean Chalard 6a43e39bf0 Make a member read-only
Change-Id: I9a718eaf07e1b6c659e649350d3605f365db2839
2012-03-02 19:17:57 +09:00
Jean Chalard d992fa847d Small refactor (A1)
Change-Id: Ia0838bbce47a2b60067f464685ad6d55ee4ec934
2012-03-02 18:55:04 +09:00
Tadashi G. Takaoka ede2133cb1 Support time, date, and datetime keyboard
Bug: 6030364
Change-Id: I2bd4daf264757d8f3fa7c946d10a39c36ccf5905
2012-03-02 14:01:07 +09:00
Tadashi G. Takaoka 961703841e Merge "Explicitly specify that labels might be in more keys" 2012-03-01 03:56:32 -08:00
Tadashi G. Takaoka e4c45c6ef9 Explicitly specify that labels might be in more keys
Bug: 6080806
Bug: 6081427
Change-Id: I455a0210e65ea2a7774e0e0071cea5f4a99577bd
2012-03-01 20:03:47 +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
Jean Chalard f3f90e6d35 Try to survive unavailability of local storage
Bug: 6035465
Change-Id: Ibe2d542349ec598824f78b91d374a977082fc2d1
2012-03-01 09:43:29 +09:00
Jean Chalard 5e4d2a0fa9 Remove logs now that we don't need them any more.
This has served its purpose, we don't need this any more.
The logging function itself can be kept since it's not called
any more. It may come in handy later.
Bug: 6053661

Change-Id: Icb40dad131793a704dbe6514cf7433e43ea04450
2012-02-22 20:45:43 -08:00
Jean Chalard 3f65960e16 Add debug prints to help with debugging
This is intended to help tracking #6048808.
Another bug has been filed to remove this once we're done with
the debugging: #6053661

Change-Id: I4547fb71926af6dc2e9c23ee4b44e4e345be6657
2012-02-22 16:16:32 -08:00
Jean Chalard 5935950d44 Rename cancelCommit to revertCommit
This wording is easier to understand, and it matches the other
revert* functions.

Change-Id: Ibc2ec79fb5a0f9bf508e5cdeb75e54abd9241d0c
2012-02-22 01:09:23 -08:00
Jean Chalard 4fef31510d Remove a useless code path (A7)
This is never called any more, since we now use the cancelCommit
path to react to a backspace after a manual pick.
This concludes the run of changes to implement feature
request #5968922

Change-Id: I23df653bb2a3de2ba0152394d5d616a42ac7519b
2012-02-22 01:05:36 -08:00
Jean Chalard bdf89ce5fe Rename cancelAutoCorrect to cancelCommit (A6)
Also remove a test in debug mode that would check for absence of
a situation which is now expected.

Change-Id: Ia5be350bc98a604b3bf8f6057652c5534f6a19af
2012-02-22 00:59:01 -08:00
Jean Chalard 2aa16dd81f Merge "Activate the code to cancel a manual pick (A5)" 2012-02-22 00:50:13 -08:00
Jean Chalard 80c25df49d Merge "Implement cancelling a manual pick (A4)" 2012-02-22 00:29:23 -08:00
Jean Chalard 8db74d0fae Merge "Use the stored separator instead of reading it back (A3)" 2012-02-22 00:24:19 -08:00
Jean Chalard 9271b770e8 Activate the code to cancel a manual pick (A5)
This finally makes active the behavior described in
Bug: 5968922

Change-Id: I363ed23270c3dea75411ea806011225097b5d07c
2012-02-22 00:05:19 -08:00
Jean Chalard 32f0af1fc4 Implement cancelling a manual pick (A4)
This is new code, but simple code. The new code path is never
used for now, but it will be in an upcoming change. This serves
to implement feature request #5968922

Change-Id: I3e67731ec6e9fc0b86c5cbd972e9c081781c11a9
2012-02-22 00:00:51 -08:00
Jean Chalard 193d23f40e Use the stored separator instead of reading it back (A3)
Now that we have stored our committing separator, we can use
it directly instead of reading it back from the text view
paying the IPC cost. This prepares for feature request #5968922.

Change-Id: Ifeaa2d659cf12b91c89d28e6ff7d07a669258184
2012-02-21 23:56:36 -08:00
Jean Chalard e043bf02f2 Merge "Give LastComposedWord knowledge of the separator (A2)" 2012-02-21 23:42:21 -08:00
Jean Chalard 1dfdc8056c Merge "Give LastComposedWord knowledge of the committed word (A1)" 2012-02-21 23:41:42 -08:00
Jean Chalard 66bb563535 Give LastComposedWord knowledge of the separator (A2)
This stores the separator that was used to commit the word in
the LastComposedWord. It may be NOT_A_SEPARATOR if there was
no separator (for example, the cursor moved causing a commit,
or there was a manual pick). This is necessary to implement
feature request #5968922.

Change-Id: I5fcf19a78ec66d68d4df89418eaef13952588207
2012-02-21 23:33:58 -08:00
Jean Chalard cf9d92629c Give LastComposedWord knowledge of the committed word (A1)
There is no point storing the prospective autocorrect - we are
recomputing it anyway. The committed word however will be necessary
to implement feature request #5968922.

Change-Id: I588c18e1a5a1050a791d601de465f421ccbe36cd
2012-02-21 23:12:21 -08:00
Tadashi G. Takaoka 1b3c16c183 Merge "Add next/prev navigate action more keys and remove tab key" 2012-02-21 23:09:58 -08:00
Tadashi G. Takaoka 05bfd189a8 Add next/prev navigate action more keys and remove tab key
Bug: 6037537
Bug: 5961814
Change-Id: I9c6dedf953452a180fcd5bce7bfadfd3c821f224
2012-02-21 22:50:50 -08:00
Jean Chalard 5262fe8832 Dismiss the hint on a non-word-starting non-separator
This would happen when a character is not a separator but is not
a word starter. Such characters include single quote and
dollar, and others non-letter, non-separator chars.
We set the bigram predictions if any - if not so configured, this
will fallback on setting back punctuations into the strip.

Bug: 6010408
Change-Id: Id203bbe87f8c13de0d5027b555c9067c7ec98f92
2012-02-21 21:16:18 -08:00
Jean Chalard b141c9cd3f Rename resources to reflect current usage
Bug: 6010403
Change-Id: Ia02ff31007296fdf6901504f238dfd9e4621f658
2012-02-21 18:54:44 -08:00
Jean Chalard 8a3d369840 Remove a useles parens
...I could swear I had compiled :/

Change-Id: I4e1fb2b1dda0a4ceffe2082935395d05297c63ec
2012-02-21 16:53:05 -08:00
Jean Chalard 9a2a11e65b Rewrite a condition
Change-Id: I805c9579788d99b015feb2075ad4771756c7adc5
2012-02-21 15:46:53 -08:00
Jean Chalard 2649e42d75 Extract a method to reset the ime state
Change-Id: I921184b85b94418cf360508ee3f67e85b10b3d72
2012-02-21 15:12:01 -08:00
Jean Chalard 5eeff7cf54 Converge paths of an if() branch
This is to help with further refactoring.

Change-Id: Ib2459903862570cf7022fd90f2d5c524a6bbbe19
2012-02-19 18:02:40 -08:00
Jean Chalard 1044539080 Rename variables and add comments
Change-Id: I746f2364d9f02f22aa6ab57d7060013ee114f4e3
2012-02-19 17:26:41 -08:00
Jean Chalard 1fead1d5f1 Read the initial selection value.
It turns out this was available in an unexpected place.
Fixes both the following bugs
Bug: 5948469
Bug: 6023118

Change-Id: Ie1a91b8268540ea0f0df02bee94c3bbdeb0fa4c5
2012-02-17 20:54:48 -08:00
Jean Chalard 1950964157 Merge "Don't assume a word has been added to the user dict" 2012-02-17 15:29:52 -08:00
Tadashi G. Takaoka 97bde43740 Settings key always exists in more keys of shortcut/f1 key
This change also
  * Fix comman/f1 key for Arabic keyboard.
  * Removes "show settings key option" and related stuff.
  * Renames and simplifies F2 key to shortcut key on 7 inch tablet.

Change-Id: Ib1cf99ad00d9780a2f0d170260e756771e161521
2012-02-17 01:04:11 -08:00
Jean Chalard 8e4b3bbf9f Don't assume a word has been added to the user dict
The user may now cancel or edit a word upon adding to the
user dictionary. We can no longer assume the word has been
added as is and for the current locale. We should just rely
on standard mechanisms that inform us of new insertions.

Bug: 6015347
Change-Id: I069b19c0c844ca29d6de4c4d162306f9413adea8
2012-02-16 19:19:05 -08:00
Tadashi G. Takaoka beb08b398f Remove unnecessary and harmful KeyboardState.onUpdateShiftState call
This change also cancels double tap and long press timers if other
letter key is pressed after shift key.

Bug: 5693999
Bug: 6017610
Change-Id: I3b5f3debfb8915fa73a93b409a38afadf24132e9
2012-02-16 18:02:17 -08:00
Jean Chalard ad290d6505 Activate bigram predictions from the binary dictionary
Change-Id: If1cc50539d7677b854b1cd3bea3423c8c0865de5
2012-02-15 19:51:24 -08:00
Charles Chen 4baf767fac Merge "Improved shift key and symbol/alpha switch key accessibility feedback." 2012-02-09 15:33:40 -08:00
Jean Chalard accd2a9f61 Merge "Add finals" 2012-02-08 19:08:09 -08:00
Jean Chalard a828f613a8 Merge "Some more simplification" 2012-02-08 19:05:46 -08:00
Jean Chalard 8ff0564f6a Add finals
Change-Id: Ib81be9a0df34c5e9fc49d2b5d9bf02297ea2b499
2012-02-09 11:40:54 +09:00
Jean Chalard 6a800b253f Some more simplification
Remove useless method calls, and ultimately remove useless
method.

Change-Id: I3f353b1b37460d5e9ceae5cb5dde3fff0da81c21
2012-02-09 11:38:03 +09:00
Jean Chalard 4721427c7d Allow revert swap punctuation again
This may not be the best behavior, but it's the same as ICS.
Bug: 5981844

Change-Id: Ibb7798e2a315312310ed3be4e731d0fe1ac04456
2012-02-09 11:34:00 +09:00
Tadashi G. Takaoka 7a39bd4454 Shift+Smiley key will register newline character of textMultiLine
This change also
 * Honors the custom action label in EditorInfo.actionLabel.
 * Invokes InputConnection.performeEditorAction if action is specifed
   at EditorInfo.imeOptions or actionLabel/actionId.
 * Stops using InputMethodService.sendKeyChar. Implements
   sendKeyCodePoint instead.

Bug: 2498607
Bug: 5961809
Bug: 5368408
Change-Id: If4cd5eb3dacfc6b6a7ea434b0617c2438e06e42d
2012-02-08 19:31:35 +09:00
Jean Chalard 82efc941ba Merge "More simplification" 2012-02-08 01:43:23 -08:00
Jean Chalard e771fc2f1a More simplification
A suggested punctuation is sure to be 1 character and a word separator,
so the isSuggestedPunctuation() test is redundant.

Change-Id: I3d31f0825f069f64d514682e46be62afdae25291
2012-02-08 18:17:51 +09:00
Jean Chalard 9159b9953d Fix the auto-composer to support supplementary chars
Change-Id: I61ff218ae2ca4eb443a370e581b677755258670a
2012-02-08 15:45:51 +09:00
Jean Chalard 8174373a0e Merge "Remove a nested edition occurence" 2012-02-07 19:42:35 -08:00
Jean Chalard 5a6daf46cf Merge "Cleanup" 2012-02-07 19:42:26 -08:00
Jean Chalard 862f950da3 Cleanup
Remove a useless test (we can only come here if the code
is not a separator, as we are only called from onCodeInput
inside an explicit test).

Change-Id: Icd996a5a1c18a550117a144a1d35f167b96211f7
2012-02-08 12:06:18 +09:00
Jean Chalard 2124bc5bf5 Remove a nested edition occurence
This was harmless but confusing

Change-Id: Ic271f80d3dadf01b29e3875c6a8ad51b99a936f9
2012-02-08 12:03:55 +09:00
Jean Chalard 2e2d6b4d40 Small simplification
Change-Id: I55f81f3ab427fd5b28bb1f31960077cd1897cbd0
2012-02-08 11:41:15 +09:00
Jean Chalard 1b986cc488 Merge "Fix a bug with manual pick then dotcom key" 2012-02-07 16:59:47 -08:00
alanv 8d4f0d5d1d Improved shift key and symbol/alpha switch key accessibility feedback.
Bug: 5933165
Change-Id: Id71f38874640785b7ad43b7a70e27f40c13be748
2012-02-07 13:14:18 -08:00
Tadashi G. Takaoka 69f672a4b3 Merge "Remove unused InputConnection argument" 2012-02-07 04:15:07 -08:00
Jean Chalard 12d67e6d5d Fix a bug with manual pick then dotcom key
Inhibit adding phantom space for tld keys even if the last
character inserted in the textview is not a dot

Change-Id: Ie92554ead7a18c932480905c5738aff7c0159a32
2012-02-07 20:36:48 +09:00
Tadashi G. Takaoka 64eaa67eb5 Remove unused InputConnection argument
Change-Id: Ic45c8c6e7730775654317fb6e2d1cb64f9031f46
2012-02-07 19:38:06 +09:00
Jean Chalard cfec7e72fd Merge "Fix a race condition that makes tests unstable" 2012-02-07 02:28:12 -08:00
Jean Chalard 816a8a0fd8 Fix a race condition that makes tests unstable
Change-Id: Ic19d380eb64855884bc6ded8547c200dd772ffe9
2012-02-07 19:22:37 +09:00
Jean Chalard 172a013ab5 Fix a bug with the auto-correct indicator
Bug: 5969106
Change-Id: I02d4b9184bb2c3fc0d08ffd5db77a9f9d816631f
2012-02-07 17:20:23 +09:00
Jean Chalard a7f2500001 Fix a bug with common objects.
Bug: 5961179
Change-Id: I452efc552c6ab390931f25557d7aee5a64bf054e
2012-02-06 18:41:00 +09:00
Jean Chalard fb684cebe8 Stop inserting a space after a manually picked word.
Bug: 4994861
Change-Id: I6ae256a94dbaddea4304304779d17025620c5025
2012-02-03 18:45:44 +09:00
Tadashi G. Takaoka 909b2940db Merge "Get rid of Key.setIcon(Drawable)" 2012-02-02 21:51:51 -08:00
Tadashi G. Takaoka e7948a8692 Get rid of Key.setIcon(Drawable)
Change-Id: If6ebbdefcbfd0cc14c72858f9bb44861e8abe079
2012-02-03 14:38:17 +09:00
Jean Chalard 825e2bbd91 Fix a bug when deleting the last char
And unit test

Change-Id: Ic4fc3626f8b86e10156d770d41cd6deab5d31f39
2012-02-03 13:03:54 +09:00
Jean Chalard 9242a2bcf8 Fix string iterations in a couple places.
Seems I didn't get how to iterate on a String correctly >.>
Talk about a big bug. Anyway, I think it's working now.

Bug: 5955228
Change-Id: I988c900cf2a16c44b9505cfd4f77c7cda7e592f0
2012-02-03 11:15:46 +09:00
Tadashi G. Takaoka 8261a4cad7 Merge "Move CSV parser to KeySpecParser" 2012-02-01 23:25:17 -08:00
Tadashi G. Takaoka 0086861d5a Move CSV parser to KeySpecParser
Change-Id: I424fb47bc70e9b6aaa5a16ae9b2500d23da75c26
2012-02-02 16:10:14 +09:00
satok e05b3f4b3a Support additional proximity characters
Change-Id: Ifbe0d7e4eafea1926bbce968eae4724dd5769689
2012-02-02 16:07:16 +09:00
Tadashi G. Takaoka 8ca325f437 Merge "Make KeySpecParser and CSV parser code point aware" 2012-02-01 22:56:54 -08:00
Tadashi G. Takaoka e01d272603 Make KeySpecParser and CSV parser code point aware
This change also renames MoreKeySpecParser to KeySpecParser

Change-Id: I35733cdbb344f16b57ffa2cfe79055c089b4e409
2012-02-02 15:51:40 +09:00
Jean Chalard 51fd1632f5 Stop throwing an exception in some corner cases.
When the application is modifying the text under our feet,
we may come through this code path. We should log the error
rather than crash.

Bug: 5869235
Change-Id: Ic0fd24c3bc805d44c5db0ad781ddebeca0450614
2012-02-02 15:15:55 +09:00
Tadashi G. Takaoka ff858c7ff5 Use MoreKeySpecParser to parse puctuations strip resources
This change also
  * Doesn't use Key.getRtlParenthesisCode to get correct parentheses
    code in RTL context. Intead uses the outputText feature of
    moreKeys specification.
  * Move CVS string parser from KeyStyles to Utils.

Bug: 5948247
Change-Id: I45752c7d01b4f7d3f3da900b110a2185b336a1f0
2012-02-01 19:33:26 +09:00
Tadashi G. Takaoka a5c96f376a Move long press shift handling from PointerTracker to KeyboardState
This change also
  * Rename phone shift keyboard to phone symbols keyboard.
    Use CODE_SWITCH_ALPHA_SYMBOL code to switch between phone and phone symbols keyboard.
  * Remove phone symbols keyboard from tablet.
  * Introduces enableLongPress flag of Key.keyActionFlags attribute.
  * Remove clumsy long press code from PointerTracker.
  * Remove CODE_CAPSLOCK handling from LatinIME.
  * Make KeyboardSwitcher to invoke haptic and audio feedback.

Change-Id: I00e1f697a10ab5112aec75e36853b96246ff5054
2012-02-01 19:04:21 +09:00
Tadashi G. Takaoka 433ca6a46d Cleanup redundant methods of KeyboardSwitcher
Change-Id: I2ebeb8852177f6c6e30578d0bb3f372f488dc6c1
2012-01-31 17:18:14 +09:00
Tadashi G. Takaoka ca2f051cc1 Auto generate various shift states alphabet keyboard automatically
If any shift state variants of alphabet keyboard layout is not
specified in KeyboardSet.Element, it will be automatically generated
from base alphabet keyboard definition.

This change also
  * Eliminates KeyboardShiftState object from Keyboard.
  * Removes various set shift state methods from Keyboard.
  * Removes KeyboardSet.Element.elementAutoGenerate attribute.
  * Separates "sticky" Key.backgroundType to "stickyOff" and "stickyOn"
  * Add preserveCase flag to smiley, .com, and labeled special keys.
  * Rename KeyboardShiftState class to AlphabetShiftState.
  * Rename some attributes from *UppercaseLetter* to *ShiftedLetterHint*.
  * Introduce shiftedLetterActivated to Key.keyLabelFlags

Change-Id: I01a0a8efeeaa76820ae728a5bdfa8d02b6ce74b7
2012-01-31 12:55:45 +09:00
Ken Wakasa 6029b43a3d Add "size" and "pressure" for MotionEvent logs
bug: 5722703
Change-Id: I8e08942324b666de96682ce63e70c8d324535782
2012-01-30 12:22:15 +09:00
Jean Chalard 449415c72f Cleanup (A9)
Deactivate the LastComposedWord when the commit was not the right
type, instead of fooling it by passing it a null auto-correction.

Change-Id: I032b477dc691bd151a644ca4b0c9f0a9b5512e45
2012-01-26 20:10:49 +09:00
Jean Chalard 5971a0a0bb Remove a useless member (A8)
It turns out this can be removed entirely.

Change-Id: I6f23703cef1666311989a825285317eef696487f
2012-01-26 20:10:49 +09:00
Jean Chalard be79227dc9 Remove the CharacterStore class (A7)
Remove the now useless WordComposer.CharacterStore class
and merge back its members inside WordComposer. This should
simplify the word composer a bit.

Change-Id: I5fe32418c62a583cd558dce98758a4701559bdf5
2012-01-26 20:03:44 +09:00
Jean Chalard c7c152de4b Guard against wrong auto-correction cancellation (A6)
This deactivates the cancellation at each separator pressed while
not composing a word. The net effect is to fix
Bug: 5875776

Change-Id: I67aa3f842ddff250828c60596ad5a7e466c1ddaa
2012-01-26 19:57:37 +09:00
Jean Chalard b6b8729374 Straighten out resuming suggestion on kept word (A5)
This is cleanup.
This also introduces a "deactivated" state to the last committed
word, that can be used for
Bug: 5875776

Change-Id: I1855adb8ac8123f6d2c5365b0ae899145e5c3ba1
2012-01-26 19:24:36 +09:00
Jean Chalard 2712f23acb Remove mCommittedWordSavedForSuggestionResuming (A4)
Change-Id: Ia62ef33b5c777a258b02280bda1b8368780a7eef
2012-01-26 18:36:28 +09:00
Jean Chalard 2692a87007 Move some functionality into LastComposedWord (A3)
Change-Id: Ie0ea02a061dd0cb84db5f33113ff433584636bc7
2012-01-26 18:25:08 +09:00
Jean Chalard 1f8fc62ccb Add useful information to LastComposedWord (A2)
Change-Id: Idf47f2e2bdd1d6394fc4b1ab7df28d64a808da1e
2012-01-26 17:49:55 +09:00
Jean Chalard 95eeb2df63 Merge "Add a class for previously composed data (A1)" 2012-01-26 00:43:57 -08:00
Jean Chalard 267563d1bb Add a class for previously composed data (A1)
Change-Id: I87498799e6a48b8fa65924a098bb0ceb7626dce1
2012-01-26 17:22:52 +09:00
Tadashi G. Takaoka 736d740aa5 Merge "Get rid of Resource reference from KeyboardView, LatinKeyboardView and PointerTracker" 2012-01-26 00:17:56 -08:00
Tadashi G. Takaoka 160f01211d Get rid of Resource reference from KeyboardView, LatinKeyboardView and PointerTracker
This change introduces the following attributes.
 * KeyboardView
   - keyPreviewLingerTimeout
 * LatinKeboardView
   - keyHysteresisDistance
   - touchNoiseThresholdTime
   - touchNoiseThresholdDistance
   - slidingKeyInputEnable
   - keyRepeatStartTimeout
   - keyRepeatInterval
   - longPressKeyTimeout
   - longPressShiftKeyTimeout
   - longPressSpaceKeyTimeout
   - ignoreSpecialKeyTimeout
   - showMiniKeyboardAtTouchedPoint

Change-Id: I25159a87289b12447e20031add173523070e9b03
2012-01-26 16:10:20 +09:00
Tadashi G. Takaoka bd51aaf98f Merge "Warn deprecated privateImeOptions, "nm" and "forceAscii"" 2012-01-25 22:20:35 -08:00
Jean Chalard 051ac1ef14 Merge "Add a guard against OOB." 2012-01-25 21:22:18 -08:00
Jean Chalard 8be16f78b1 Add a guard against OOB.
...and avoid crashing in one case where the application may
change the text while we are typing.

Bug: 5685922
Change-Id: I4a22c63168986f43ac84f512aaa4267023d536e3
2012-01-26 14:17:48 +09:00
Jean Chalard 5a38ff305f Merge "Convert an internal enum into an int of same underlying value." 2012-01-25 21:13:56 -08:00
Tadashi G. Takaoka 4f5c3a2898 Warn deprecated privateImeOptions, "nm" and "forceAscii"
Public API EditorInfo.IME_FLAG_FORCE_ASCII has been supported by
I6665b483.

Change-Id: I0ffdee15d8177d126cd8fe86a6bc4ab21be58c36
2012-01-26 13:37:35 +09:00
Jean Chalard 6e082cb30d Convert an internal enum into an int of same underlying value.
Goes together with Id4f4e066

Bug: 5922118
Change-Id: I1e39dd01c67e9284d9d7fe008d868847e69986d7
2012-01-26 13:07:51 +09:00
Jean Chalard fda847a870 Small cleanup
All calls to this method are done with the same parameter,
and it's really hard to understand if we call upon this
member inside.

Change-Id: I787664bb59053ab0fe666ed812fb12b2b9090918
2012-01-26 11:40:16 +09:00
Jean Chalard d9702a375a Merge "Add a test for auto-correction." 2012-01-25 02:33:39 -08:00
Jean Chalard 0bfe359ee4 Add a test for auto-correction.
Fix two related subtle bugs:
- Stop singling out fat-finger-only corrections for rejection
  when touch coordinates are not available.
- Remove a racy check that would happen only in debug mode

Change-Id: Ic904f9b27c091ca6b369052c4e65a630bff81257
2012-01-25 19:29:40 +09:00
Tadashi G. Takaoka 38d6a18821 Use String instaed of CharSequence in Key class
Change-Id: Ia76a41daede402ed2a509e110ae97d6bb660c760
2012-01-25 17:04:00 +09:00
Jean Chalard 77da3d5a3b Fix a bug where backspace would not delete the selection
Bug: 5699301
Change-Id: I6c5a8470464d045349ac38e191c859b5c34cbeee
2012-01-24 18:07:23 +09:00
Jean Chalard 5fd11a7f33 Fix a typo
Change-Id: I358350c959d5610214a752b14d7744fe83eb3821
2012-01-24 11:58:07 +09:00
Jean Chalard 35e9a7ac55 Merge "Squash a ridiculously improbable NPE" 2012-01-22 18:37:29 -08:00
Tadashi G. Takaoka 54c2dd67b0 Merge "Support @string reference in moreKeys attribute" 2012-01-20 01:59:31 -08:00
Tadashi G. Takaoka e54a4005d5 Support @string reference in moreKeys attribute
Change-Id: If0056d0601149d2ddd0e231a81e7b2409b37fc06
2012-01-20 18:46:33 +09:00
Jean Chalard 7c177e82af Merge "Fix a bug where a check would fail" 2012-01-20 01:16:44 -08:00
Jean Chalard 7546ff6e34 Fix a bug where a check would fail
Bug: 5894393
Change-Id: I810de58730f2cabcaf7b8dc1d85b3725f959094b
2012-01-20 18:09:59 +09:00
Tadashi G. Takaoka 3eede315dc Merge "Move MoreKeySpecParser.getResourceId to Utils" 2012-01-20 00:01:29 -08:00
Tadashi G. Takaoka 0718590486 Move MoreKeySpecParser.getResourceId to Utils
Change-Id: I0640dbe76a8ff2dc45b504eca631942811571736
2012-01-20 16:28:18 +09:00
Jean Chalard af9fe5c5fc Fix a bug where the user typed word would not be passed.
Bug: 5894271
Change-Id: I4f02ff322697159e08f5e898608c0aff11dacb2f
2012-01-20 15:39:06 +09:00
Jean Chalard 250cf0a781 Merge "Fix a bug with backspace happening after a manual pick." 2012-01-19 01:55:30 -08:00
Jean Chalard 3b2112e70a Fix a bug with backspace happening after a manual pick.
Bug: 5884397
Change-Id: I01f462075bcbf7da38e9af2084ecd37143923e8b
2012-01-19 18:41:02 +09:00
Jean Chalard 95a6e58ebc Small code simplification.
I'm pretty sure the test here was useless.

Change-Id: Iaece641fbd5455406533b19555f2b639759a525f
2012-01-19 18:03:45 +09:00
Jean Chalard af480be66e Squash a ridiculously improbable NPE
This probably can't be triggered by anything that is not
a monkey, but still, let's fix this

Bug: 5797549
Change-Id: I9a7d9fd6664c97787ce676a28675e96f46df7658
2012-01-19 12:06:00 +09:00
Tadashi G. Takaoka 5731b939c7 Remove KeyboardSwicther.toggleCapslock
Change-Id: Id613c06e2df770659095d78d42637aed063d0c70
2012-01-17 19:26:24 +09:00
Tadashi G. Takaoka 2a88440419 Rename KeyboardActionListener methods
* Rename KeyboardActionListener.onPress to onPressKey
* Rename KeyboardActionListener.onRelease to onReleaseKey
* Merge KeyboardSwicther.onPressShift, onPressSymbol, and onPressOtherKey to onPressKey.
* Merge KeyboardSwitcher.onReleaseShift and onReleaseSymbol to onReleaseKey.
* Merge KeyboardState.onPressShift, onPressSymbol, and onPressOtherKey to onPressKey.
* Merge KeyboardState.onReleaseShift and onReleaseSymbol to onReleaseKey.

Change-Id: Icf28fd18e238c5e534c292893e4ab5b6b98e72f8
2012-01-17 19:07:20 +09:00
Tadashi G. Takaoka c9fade6b87 Merge "Remove toggleShift and toggleAlphabetAndSymbols from KeyboardSwitcher" 2012-01-17 00:07:38 -08:00
Tadashi G. Takaoka 87e025da11 Remove toggleShift and toggleAlphabetAndSymbols from KeyboardSwitcher
Change-Id: I9bb8f78b0a766cd7937d5cbe1c1e5e35898b2997
2012-01-17 16:49:33 +09:00
Jean Chalard d104a7aac8 Merge "Fix a bug where words disappear on inserting separators" 2012-01-16 23:22:03 -08:00
Jean Chalard edc6395d9b Fix a bug where words disappear on inserting separators
The basic idea is that in some situations, we would restart
suggestions, but before evaluating them we would bail out
because suggestions were not requested. This would lead to
the "correction" set to null, so we would commit a null word.

This fix does two things:
- Do not restart suggestions when not requested.
- If we still end up with a composing word when suggestions
  are not requested, we select the typed word as the
  correct version.

Bug: 5846646
Change-Id: Ic35351841d0cb20afa99092ef681ecb7bd68bec6
2012-01-17 16:16:52 +09:00
Jean Chalard aed5819a84 Merge "Fix a bug where suggestion would restart at a bad time" 2012-01-16 22:51:23 -08:00
Jean Chalard fbd1ac8083 Fix a bug where suggestion would restart at a bad time
Bug: 5846646
Change-Id: I7c907d0a9478e0878b92ead94173caefc21b627b
2012-01-17 15:50:18 +09:00
Tadashi G. Takaoka 1ef6fc7e15 Support EditorInfo.IME_FLAG_FORCE_ASCII
Bug: 5850605
Change-Id: I6665b483f775094903f2e26f5584e4b141592ab5
2012-01-17 14:38:00 +09:00
Tadashi G. Takaoka edf107e2a6 Merge "Add "force non-distinct multitouch" debug option" 2012-01-16 20:22:36 -08:00
Tadashi G. Takaoka 06b7c256b1 Add "force non-distinct multitouch" debug option
Change-Id: I9fd6fabf03515011cedb8aaa30fdb7a77f2d4d12
2012-01-17 13:19:01 +09:00
Jean Chalard a8ba49c253 Small cleanup
The method deleteWordAtCursor would call finishComposingText,
which is a very unexpected state change and would probably cause
surprising bugs to any parent that would call it.
As it happens, it's not used anywhere any more so let's just
remove it.

Change-Id: Iaa9200866e40b4e914f76baa987279948300679c
2012-01-17 11:55:23 +09:00
Jean Chalard 72d285f4d7 Add some comments about resuming auto-suggestion
Bug: 5846646
Change-Id: Ib2c76ec173972eb7acadbfaae7e930849d546721
2012-01-17 10:29:11 +09:00
Tadashi G. Takaoka 9751a626ec Don't cache resource value that depends on orientation
Bug: 5794655
Change-Id: Ib324366c772e20bb54aba63c2f4540dc0f9de515
2012-01-16 12:26:34 +09:00
Tadashi G. Takaoka 211680e375 Merge "Fix SuggestTests" 2012-01-13 01:39:43 -08:00
Tadashi G. Takaoka 9c735b8038 Fix SuggestTests
We need revised scoring test because dictionary look up algorithm has
been changed significantly since this SuggestTests was made.

Change-Id: I69d527a6bfa24ed0dc189fddad1afab0566c6eb8
2012-01-13 15:25:28 +09:00
satok 4da8e8e4d3 Merge "Fix a bug in the logic to show 3 dots of the ime switcher" 2012-01-12 19:41:12 -08:00
satok 83a018419a Fix a bug in the logic to show 3 dots of the ime switcher
Bug: 5806103
Change-Id: I67b3f0bb25d5fb9cfb902c03f41ae3e582107187
2012-01-13 11:50:31 +09:00
satok 21814c56f0 Merge "Move auto correction thresthold to the native code" 2012-01-12 02:58:35 -08:00
satok be0cf72253 Move auto correction thresthold to the native code
bug: 5858137

Change-Id: Ic4b6270c6e51ef4ed25a6a1d8ddd7fdfa70fd78d
2012-01-12 19:56:15 +09:00
Jean Chalard ab34a4a7f5 Merge "Fix a bug where last candidate would not be reset" 2012-01-11 21:47:35 -08:00
Jean Chalard cda8a42cbe Merge "Add a sanity check" 2012-01-11 21:47:26 -08:00
Jean Chalard a8c8ab1cb4 Remove an excessive parens
Change-Id: If8aa4253ab0f664e628ed7f4d7a3adc02a898cc7
2012-01-12 14:07:56 +09:00
Jean Chalard 852630ba34 Add a sanity check
Check if any character is both a magic space swapper and
a magic space stripper for the current language, and throw
an exception if found. Since this is expensive, it's done
only in debug mode.

Change-Id: Ibd166db87c91495b76878ea0e4f420a62c7bb276
2012-01-12 12:44:49 +09:00
Jean Chalard 9de5cfc67a Fix a crash where revertSwap would be wrongly called
This would crash the program when inputting a punctuation
symbol that should not swap with a weak space through the
suggestion strip, then press backspace.
Those include all two-part punctuation symbols in French for
example, as well as magic space strippers like the dash in
English. For English all suggestion strips symbols happen to
be magic space swappers so this would not happen in English
by default.
Also fix a typo.

Change-Id: Ia40678c264e978509b5786290a75a3c57181648e
2012-01-12 11:55:40 +09:00
Jean Chalard cd2286fff1 Fix a bug where last candidate would not be reset
Bug: 5851148
Change-Id: Ic270318842d8e16bc62d78d5fe0d6be0ca1fb532
2012-01-12 11:16:51 +09:00
Tadashi G. Takaoka 8cab0b56eb Get rid of Keyboard.CODE_DUMMY
Change-Id: Id2320f4d9b5f22f0ac844ab20ce42b0c4e7c6880
2012-01-10 18:19:36 +09:00
Tadashi G. Takaoka ee4be6e3c6 Call KeyboardState.onUpdateShiftState from onCodeInput if code is a normal letter
This will be helpful to write unit test code.

Change-Id: Ib61cc46ac547084e0dc9ecd3a50814fecf08ace2
2012-01-10 15:13:05 +09:00
Ken Wakasa 0d0f01da67 Fix a typo. A follow up to I68dd6b8d
Change-Id: I16fa4099c75faac35344b0e4d3c2b866ddac896a
2011-12-21 22:34:08 +09:00
Jean Chalard 0fd625bcfd Fix a bug with wrong auto-correct cancellation
Auto-correct cancellation would sometimes kick in at
wrong times, causing crashes.

Bug: 5784542
Change-Id: I68dd6b8d9237ce9b66af2dc63e77ba6dd5fd69dd
2011-12-21 19:28:02 +09:00
Jean Chalard 752d8cc4fc Fix a bug with TYPE_TEXT_CLASS
This was introduced by a badly-rebased commit. The culprit was
I103d6851. There was also another bug lurking there introduced
by a previous commit that this fixes.

Bug: 5775347
Change-Id: I133b54a5159e19714f4bcae8ffbb4824cff9f466
2011-12-20 15:31:55 +09:00
Jean Chalard 9e8761c440 Reorganize the auto-correction memory
Change-Id: I31cce9db471dcd4a7b3477bcb037a8ff482b7696
2011-12-19 17:33:15 +09:00
Tadashi G. Takaoka 4e1dab8cfa Move KeyboardBuilder and KeyboardParams classes into Keyboard class
This change also moves XmlParseUtils to com.android.inputmethod.latin package.

Bug: 5778201
Change-Id: I7d9faa344460753ce178ad4048e0fadb65c75614
2011-12-18 20:19:16 +09:00
Tadashi G. Takaoka 3708787fe9 Remove LatinKeyboard class
Change-Id: I68c667b00dadf2ed9f1c62fb7da37d2cf499cd81
2011-12-18 19:10:42 +09:00
Tadashi G. Takaoka 4112dc0500 Move spacebar drawing code from LatinKeyboard to LatinKeyboardView
Also this change moves LatinKeyboard attributes,
autoCorrectionSpacebarLedEnabled, autoCorrectionSpacebarLedIcon,
spacebarTextRatio, spacebarTextColor, and spacebarTextShadowColor to
LatinKeyboardView.

Change-Id: I7cc27ce1fc550e9f620a9ed0fbe4b8172902d5a1
2011-12-18 19:07:12 +09:00
Tadashi G. Takaoka 22b48de11c Get rid of Key.needsSpecialPopupHint and related
Change-Id: I28e87ea3af9581f12094770b42f113e9018886c4
2011-12-18 16:08:28 +09:00
Jean Chalard 43c0a034bd Merge "Pretty print for InputAttributes" 2011-12-16 04:01:49 -08:00
Jean Chalard 4d0f03bd66 Remove a write-only variable.
Change-Id: I825307a429f46b31ed9bd940b5a97d2713127dfe
2011-12-16 20:54:58 +09:00
Jean Chalard 6fa003ee23 Pretty print for InputAttributes
Change-Id: I5e4b2b6f3cd943c8f6187aaed21d67ec786bf5df
2011-12-16 20:53:44 +09:00
Jean Chalard 2b2c0b574c Merge "Use the WordComposer to check if we are composing a word" 2011-12-16 03:47:34 -08:00
Jean Chalard 80b66bb166 General cleanup.
Move variables around, inline useless functions, remove
useless local variables.

Change-Id: Icb89d8b211a2ad4bc3619137c2276a649c2a5e34
2011-12-16 20:36:32 +09:00
Jean Chalard 644c8b7c96 Initialize input attributes in the InputAttribute class
Change-Id: I103d6851f54f47cbffdb567fb0f4c505c4697b05
2011-12-16 20:35:16 +09:00
Jean Chalard 3b7aceca60 Merge "Make applicationSpecifiedCompletionOn final." 2011-12-16 03:20:00 -08:00
Tadashi G. Takaoka bf7ed75e4f Merge "Move KeyboardSwitcher.getKeyboard to KeyboardSet" 2011-12-16 03:13:38 -08:00
Tadashi G. Takaoka 645128af71 Move KeyboardSwitcher.getKeyboard to KeyboardSet
This change also gets rid of XML id from KeyboardId.

Bug: 5002108
Bug: 5679585
Change-Id: I7086c7da3c01ba4ade7f77ee5cc731310da46404
2011-12-16 20:10:57 +09:00
Jean Chalard ccc35f7fa7 Make applicationSpecifiedCompletionOn final.
This is the last one (whew)
Also move a somewhat unrelated initialization out of the
input attribute initialization function.

Change-Id: Icc77b32fd16b112ab43786715061b1c9dca31c04
2011-12-16 19:09:01 +09:00
Jean Chalard 9cc1312eee Make inputTypeAutoCorrect final.
Change-Id: I550eba1fc3fa2843d007a8208d81fad208c1196b
2011-12-16 19:08:52 +09:00
Jean Chalard 13db05f930 Make isSettingsSuggestionStripOn final.
Change-Id: Iabb99a7f8f3f1777f9a87ae2bddff9795a50fa92
2011-12-16 19:08:13 +09:00
Jean Chalard 1ba17f97d5 Small refactoring
This helps to make following changes smaller

Change-Id: I95ba2901ac3bf1ed70a748c35a0babdd9af1df63
2011-12-16 18:21:26 +09:00
Jean Chalard 4fc0f6ab02 Merge "Make insertSpaceOnPickSuggestionManually final." 2011-12-16 01:15:35 -08:00
Jean Chalard 2ad14a2ea7 Merge "Use temporary variables for computing editor attributes" 2011-12-16 01:07:56 -08:00
Jean Chalard 520e69056e Merge "Create a class for input attributes." 2011-12-16 01:06:12 -08:00
Jean Chalard ae0c109d11 Make insertSpaceOnPickSuggestionManually final.
Change-Id: I32fce0ea8c5c58b6f920d0758c8bf57769f39a12
2011-12-16 18:04:39 +09:00
satok cadc0f7d79 Merge "Send touch event in usability study mode" 2011-12-16 01:04:26 -08:00
Jean Chalard 4e8922f1be Use temporary variables for computing editor attributes
The ultimate intent is to make these variables final,
which will allow to move the computing function to the
InputAttributes class.

Change-Id: Ifb1fc7321a19b10d60aa63fa0daaa2708deda2cf
2011-12-16 18:04:17 +09:00
Jean Chalard dc9d0fcc11 Create a class for input attributes.
Change-Id: I834390c83865aac59fb758d5c66cf9b74103abd8
2011-12-16 18:03:16 +09:00
satok 15d4793911 Send touch event in usability study mode
Change-Id: I0cdcd57bfd31c9b21cfb932d7ff91bd013cde6d7
2011-12-16 17:56:14 +09:00
Jean Chalard 196d82cdd7 Use the WordComposer to check if we are composing a word
...instead of the hard-to-understand mHasUncommittedTypedChars.
This is possible because now the word composer is actually aware
of commits.

Change-Id: I36b664ce8402a280f801e87b9ebe161f416b0853
2011-12-16 15:58:29 +09:00
Jean Chalard be2f81f055 Merge "Make the word composer aware of commits." 2011-12-15 22:54:23 -08:00
Jean Chalard c73c26790f Make the word composer aware of commits.
Change-Id: I04e691fbc9227d4df195429bca89edea93575347
2011-12-16 15:41:10 +09:00
Tadashi G. Takaoka 8c3d5b6961 Add com.android.inputmethod.latin.suggestions package
Change-Id: If4b823768ab9c073625da3034ecc8091be1df230
2011-12-16 14:21:44 +09:00
Tadashi G. Takaoka a44685ab32 Add colorValidTypedWord and alphaValidTypedWord
This change fixes Gingerbread theme.

Change-Id: I142437ac0173df48ab36390f47ed67c6cea24a65
2011-12-16 12:26:19 +09:00
Tadashi G. Takaoka e9a0efc242 Merge "Cleanup unused variables and parameters" 2011-12-15 18:02:38 -08:00
Tadashi G. Takaoka 2ac5988f84 Cleanup unused variables and parameters
Change-Id: Iad756a7a775c93f3344c6962e7b3456ef8339490
2011-12-15 20:26:12 +09:00
Jean Chalard 05f654d498 Merge "Group all input-related info into an inner class." 2011-12-15 03:21:47 -08:00
Tadashi G. Takaoka c3ef86d861 Merge "Fix auto correction spacebar LED" 2011-12-15 03:19:32 -08:00
Jean Chalard 27dff63833 Group all input-related info into an inner class.
Currently, these variables hold the info about the composing
word, or maybe some outdated info, and it's not very clear
which it is. LatinIME is maintaining the freshness info in
a separate boolean, and uses it throughout the code for many,
many things, leading to much confusion.
The idea in grouping this info is, it can be saved in another
instance and restored later. It can be tested against to know
whether there is actually outdated but kept info or not, and
it should allow to straighten out what is actually currently
being typed. Ultimately, it will eliminate the need for
LatinIME to keep track of the status of the info in the
word composer.

Change-Id: I00e2c690f303f8320c9be35590a6df4583e9e456
2011-12-15 19:58:04 +09:00
Tadashi G. Takaoka 2d74806262 Change visibility to avoid synthetic accessor method
Change-Id: Ie93c7437fb9a3fe63adaa48c2d4a723f96c0a0e1
2011-12-15 19:50:53 +09:00
Tadashi G. Takaoka 23d27fefcb Fix auto correction spacebar LED
Change-Id: I4894d188d5612380cc9f8eec7cb72544e37fb2b0
2011-12-15 17:34:14 +09:00
Jean Chalard f3ca6a59a7 Cleanup
Change-Id: I724df0be7ac07ffb9f1f4974175aed5a2606221b
2011-12-14 18:42:47 +09:00
Jean Chalard 1c6cf26c37 Move some code inside a function to simplify flow
Also rename the function to reflect better the behavior.
An upcoming change will clean up the remnants

Change-Id: I19bdf0d9e95f62ee749e1f64fe17132c4a5ef0bc
2011-12-14 17:56:57 +09:00
Jean Chalard 46798d8f1f Fail faster in case of a bug
Change-Id: Ibea64133f200dce80034c641d4798b62843a2512
2011-12-14 17:54:18 +09:00
Jean Chalard b588003426 Refactoring.
Small simplification of the code.

Change-Id: I1f67ae529bbb2c9316bf5e083d367c57040ea22c
2011-12-14 16:59:25 +09:00
Tadashi G. Takaoka e35e13fc7d Merge "Record onStartInputView" 2011-12-13 23:31:43 -08:00