Commit Graph

876 Commits (c05a70a4ca769664f2315fff1f3bf3cb2ce3e300)

Author SHA1 Message Date
Brett Chabot c05a70a4ca Migrate packages/inputmethods/LatinIME to androidx.test
See go/jetpack-test-android-migration

Test: make checkbuild
Change-Id: I63edeced1465725cd8d6467cd75ea1acc2608932
2018-12-13 19:06:42 -08:00
Tadashi G. Takaoka b6301306fa Merge "Fix dicttool build" am: a92d0f9262 am: 438a303732
am: 6aed05232b

Change-Id: I558fb5ff22a7428d1d82eac82b4caba469ed48d4
2018-10-31 09:24:08 -07:00
Tadashi G. Takaoka 6a1b37353d Fix dicttool build
This CL partially reverts
  - Id88b02b74bdfe4ca05b08181ceb6b34d5652fc0c
  - I05c7d8429e8d9a26139456763c77997340fea8c2
And followup (remove shortcut support)
  - I73b7dc008a5acaf75a31a36a2d332b5afabd82d0

Bug: 28255684
Test: make -j10 dicttool_aosp
Change-Id: I2e01ed86b9517a1141aee35ea6d8ef39258981d1
2018-10-29 15:59:05 +09:00
Yohei Yukawa d6525756a1 Add missing test runner annotations
These tests are supposed to run even withotu @RunWith annocation, but
for better consistency we should have it there.

Bug: 110805255
Test: verified as follows. No new test failures.
    tapas adb LatinIME LatinIMETests arm64 userdebug && \
    DISABLE_PROGUARD=true make -j LatinIME && \
    adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \
    atest LatinIMETests:com.android.inputmethod.latin.ContactsDictionaryUtilsTest && \
    atest LatinIMETests:com.android.inputmethod.latin.ContactsContentObserverTest
Change-Id: I5c115d57b2ad41642f5f9b09b0c0d8f8c12480b0
2018-08-13 14:36:49 -07:00
Yohei Yukawa c0aa76f897 Migrate to Android Testing Support Lib (part 7/N)
InstrumentationTestCase and ActivityInstrumentationTestCase2 are
deprecated.  This CL rewrites tests that rely on those deprecated
classes by using Android Testing Support Library.

Bug: 110805255
Test: verified as follows. No new test failures.
    tapas adb LatinIME LatinIMETests arm64 userdebug && \
    DISABLE_PROGUARD=true make -j LatinIME && \
    adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \
    atest LatinIMETests:com.android.inputmethod.keyboard.internal.MoreKeySpecStringReferenceTests LatinIMETests:com.android.inputmethod.latin.settings.AccountsSettingsFragmentTests
Change-Id: I4fefccaa0c480cfba7142ed36883da2f19b6a5f9
2018-07-24 11:29:20 -07:00
Yohei Yukawa 560a5bc596 Migrate to Android Testing Support Lib (part 6/N)
This is a follow up CL to previous CLs that converted unit tests to
use Android Testing Support Library but forgot to remove unused import
lines.

Bug: 110805255
Test: verified as follows. No new test failures.
        tapas adb LatinIME LatinIMETests arm64 userdebug && \
        DISABLE_PROGUARD=true make -j LatinIME && \
        adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \
        atest LatinIMETests:com.android.inputmethod.latin
Change-Id: I8762b0dfc209bdf68867f725b03a22286026faae
2018-07-23 17:19:51 -07:00
Yohei Yukawa d3b93cc950 Migrate to Android Testing Support Lib (part 5/N)
This CL converts 19 test classes under com.android.inputmethod.latin
to Android Testing Support Library.

Bug: 110805255
Test: verified as follows. No new test failures.
        tapas adb LatinIME LatinIMETests arm64 userdebug && \
        DISABLE_PROGUARD=true make -j LatinIME && \
        adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \
        atest LatinIMETests:com.android.inputmethod.latin
Change-Id: I878fcae0126f57c43a644af341e5a0a8ac8f5cc9
2018-07-06 10:10:54 -07:00
Yohei Yukawa 9c49581eeb Migrate to Android Testing Support Lib (part 1/N)
This CL converts tests under com.android.inputmethod.latin.utils to
Android Testing Support Library.

Bug: 110805255
Test: verified as follows. No new test failures.
        tapas adb LatinIME LatinIMETests arm64 userdebug && \
        DISABLE_PROGUARD=true make -j LatinIME && \
        adb install -r $OUT/system/app/LatinIME/LatinIME.apk && \
        atest LatinIMETests:com.android.inputmethod.latin.utils
Change-Id: I5cc2ddbc4116003ab6407432ab521b6b560052ae
2018-07-05 13:45:04 -07:00
Yohei Yukawa 2802250415 Remove unused class PersonalDictionaryLookup
PersonalDictionaryLookup has never been used.  Usually proguard can
remove this class but it also makes it difficult to run unit tests.

We should just remove this unused class.

Bug: 111164993
Test: compile
Test: No new test failure
Change-Id: I732db94cb3aac4ed9c6b5954679b896334a12a9c
2018-07-04 23:13:18 -07:00
Mohammadinamul Sheik 604158669b [LatinIME] Support MNC permissions.
This build has been compiled against API 23

This build is approved to go out with the M OTA, but may NOT be released
to the public until the Play Store has enabled API level 23 apps

Version: 4.1.2300x.build_id

1. Replaces the personalization is on information with the suggest
   contacts.
2. Enables "Use Contacts" only if the app has permission to read
   contacts.
3. Disables the contacts dictionary in the Facilitator.
4. Do not register/read the contacts in the contact observer.

Bug: 22236416
Change-Id: I9674e13d0d0f4a2014c5024fde0178de684c07e7
2015-07-15 22:51:53 +00:00
Tom Ouyang f470729df2 Fix breakage in tests.
Change-Id: I4f0472b9f2ea2daeeba3025c588e6d0042c31be7
2015-06-23 13:52:19 -07:00
Tom Ouyang cdfe8b93ec Merge "Add affinity model for contact names." 2015-04-17 01:05:44 +00:00
Tom Ouyang 44a175732d Add affinity model for contact names.
This allows us to:
1. Rank contacts and only add the top N names to the keyboard LM.
2. Avoid adding duplicate names.

Note: The affinity calcualuation is limited by the fact that some apps
currently do not update the TIMES_CONTACTED counter. To better handle
this case, the new measure also takes into account whether or not a
name is in the visible contacts group.

Bug: 20053274
Change-Id: I2741cb8958667d4a294aba8c437a45cec4b42dc7
2015-04-16 11:33:54 -07:00
Jatin Matani 1bfd7be208 Store raw strings for personal dictionary
The raw strings would be sent to personal LM for decoding.
Earlier lowercased strings were being used with the purpose
of isValid checks (spelling does not consider casing for spell
checking calls). But for showing these in suggestion, we need the
raw strings.

Note: PersonalDictionaryLookup#getWordsForLocale is used to feed
the personal LM in PersonalLanguageModelHelper.

Bug:20152986
Change-Id: I9d796fa57bf2073036bf11d86b143ff205a6199c
2015-04-13 16:28:26 -07:00
Dan Zivkovic 541ef56e05 Personal dictionary feeds a personal LM.
Bug 20043003.

Change-Id: I5ccac344c089855474263d1cdc547da1e6779301
2015-04-09 18:35:57 -07:00
Dan Zivkovic ec2891b007 Define stats for UserDictionaryLookup.
Bug 20071513.

Change-Id: Iaab909575da29bfe6e17bb3865ce51d1e7720e7c
2015-04-06 11:10:55 -07:00
Dan Zivkovic c79ed10cf7 Merge "Revert "Declare that LatinIME does not use cleartext network traffic."" 2015-04-06 15:33:26 +00:00
Dan Zivkovic a9a46a6408 Revert "Declare that LatinIME does not use cleartext network traffic."
This reverts commit 24a9683ac9.

Change-Id: I6f305aac6ac8d5c550a39eb5c88ec2881203cecc
Reason: Breaks a clean build on master.
2015-04-06 15:32:19 +00:00
Alex Klyubin 5760cdf750 Merge "Declare that LatinIME does not use cleartext network traffic." 2015-04-03 20:32:46 +00:00
Dan Zivkovic 5a53505fe4 Log interrupted tasks in AOSP.
Bug 19987461.

Change-Id: Ia2714f555146f8f31a6d8c61f555d2b6fecdab7d
2015-04-02 14:47:36 -07:00
Alex Klyubin 24a9683ac9 Declare that LatinIME does not use cleartext network traffic.
This declares to the platform and tools that this app does not use
cleartext network traffic. The platform and tools will be blocking
(on best effort basis) attempts to use such traffic by this app.
For example, attempts to use HTTP (rather than HTTPS) will be blocked.

Bug: 19215516
Change-Id: I4c933a214457025797e077b72d8daf8a0c876923
2015-04-02 13:32:22 -07:00
Dan Zivkovic 87eb7ac29c Add shortcut support to UserDictionaryLookup.
Also move the class to the parent package, since it's no longer tied to the
spell checking service.

Bug 19966848.
Bug 20036810.

Change-Id: I35014d212fd87281eb90def03ee92e6872dcd63e
2015-04-02 11:15:27 -07:00
Chieu Nguyen d4ee11f9a4 "spellcheking" needs spellchecking.
Change-Id: Iaf4cd5d11b113be4738182fb662e5dc54b2f5366
2015-03-27 14:48:20 -07:00
Mohammadinamul Sheik 8f526c9a55 Use the complete Locale in generating the dictionary id.
- Also deleted a couple of dead methods.

Bug:19929051
Change-Id: I4f88dbc2a8204d5e2a20d1ad8c205a23c6319f8d
2015-03-25 16:45:56 -07:00
Dan Zivkovic 4262ef4e11 We can't spell check Russian without an LM.
Change-Id: I635a51acc2e45aebe23a1cf69da1b5c72a6ac9e1
2015-03-23 16:37:13 -07:00
Dan Zivkovic ffd808b446 We ship with English, so we can't unit test French
Change-Id: I20a470a18ca0cd47fe7588958be904eb23fdf1a2
2015-03-23 14:42:10 -07:00
Dan Zivkovic 3e792f61ad Minor unit test fixes.
Change-Id: I800bb33a10f31d5b934b00768bc8fe4776e36f90
2015-03-23 13:31:51 -07:00
Jatin Matani cb27c4fe2e Move ManagedProfileUtils to overridable
Bug:19532354
Change-Id: I50b3ae11b6e58f07b482353b624b1a7a73eadc99
2015-03-23 11:57:48 -07:00
Dan Zivkovic b98a0380ff Fix InputLogicTests.
Change-Id: Ie319a6087297251e6b22ffd80014b69c746458e0
2015-03-20 14:13:25 -07:00
Dan Zivkovic c15bbb52a3 Retire Delight2 migration code to speed up tests.
We're waiting 10 minutes for tests to run, and half of that time is spent in
depreacted code related to migration of Delight2 dictionary files.
LatinIME will never migrate another Delight2 dictionary file again, so we can
delete this code.

Change-Id: I05c7d8429e8d9a26139456763c77997340fea8c2
2015-03-20 11:16:46 -07:00
David Faden 6e86632311 Pass DictionaryFacilitator to GestureConsumer#onImeSuggestionsProcessed.
Bug: 19712589
Change-Id: I81f9bf09b37487450780d85a1e4f752a9ba49370
2015-03-19 18:23:35 -07:00
Mohammadinamul Sheik ab59129594 Add prev words context to the SuggestedWordInfo.
Bug: 19712589
Bug: 19715579
Change-Id: Ie06665cab8405455c1b0a2ff034e0bb0731c9156
2015-03-19 16:07:04 -07:00
Chieu Nguyen b56f7d8ca4 Merge "Disable message if personalization is disabled." 2015-03-18 22:36:10 +00:00
Chieu Nguyen 8ec36026c9 Disable message if personalization is disabled.
Bug: 19087415.
Change-Id: I3974f1b676aa4a9bb04ab7f609b6daf1860c64f1
2015-03-18 15:30:22 -07:00
Mohammadinamul Sheik 62596b61c5 Fix the BlueUnderlineTests.
changed the usecase that fits the new decoder behavior.

Change-Id: Ie31675f55af9f0b0b635e65d84bb629e1c89383e
2015-03-18 14:15:45 -07:00
Mohammadinamul Sheik 25433d7a0b Fix the RichInputConnectionAndTextRangeTests
Change from sentence seperator to sentence terminator has broken
this tests.

Change-Id: I303a2e703c46191b481b7d32213f165bd00aaaa2
2015-03-18 11:33:57 -07:00
Tom Ouyang edcf5853d1 Merge "Start-of-sentence should include newlines and non-period terminators." 2015-03-17 22:25:00 +00:00
Tom Ouyang 5aeb092130 Start-of-sentence should include newlines and non-period terminators.
Bug: 19795382
Change-Id: Id6cc4a494a06de03d351aa6257632bd3b82e2ec4
2015-03-17 15:18:42 -07:00
Mohammadinamul Sheik 775d3a8d53 Merge "Use BinaryDicitonary.MAX_PREV_WORD_COUNT_FOR_NGRAM for D2 dictioanries." 2015-03-17 19:10:15 +00:00
Mohammadinamul Sheik f468609223 Use BinaryDicitonary.MAX_PREV_WORD_COUNT_FOR_NGRAM for D2 dictioanries.
Fixes the UserHistoryDictionaryTests

Change-Id: I49776f53298ced3cd7e771cfe77a940b80b01f20
2015-03-17 11:43:16 -07:00
Dan Zivkovic cab6fa3e1b Fix some InputLogicTests.
Change-Id: I3dd080844ee96dd60ab50ddc74632181dec775a2
2015-03-17 11:15:18 -07:00
Dan Zivkovic bff393ce13 Fix NPE in AccountSettingsFragment.
Bug 19773815.

Change-Id: Ib5eb27cdf385c81d1a3822836f424fa29c0bbaa8
2015-03-16 17:08:35 -07:00
Dan Zivkovic 52dafe8c32 Don't test format version 403 twice.
BinaryDictionaryTests runs all tests 3 times for 3 format verisons.
Cut that number down by 33% to speed things up.

Change-Id: I8a2f78017fa30f46b5873dcf6a5f478f57af2ebd
2015-03-16 14:38:44 -07:00
Dan Zivkovic 5455179b54 Revert "Next-word suggestion bit in keyboard settings."
This reverts commit 1ae16dc3db.

Bug 19596067.

Change-Id: Ie7286acbb70b215d7bd08e271bcf14526b68576f
2015-03-16 11:23:22 -07:00
Mohammadinamul Sheik 29500ef4ba Fix the BinaryDictionaryTests
Change-Id: I09378d74705e6943946ea4f76b15664086a387ed
2015-03-13 18:21:22 -07:00
Chieu Nguyen 116e58c437 Remove autocorrection aggressiveness settings.
Replace multiple settings with binary switch for autocorrection.

Bug: 19589766
Change-Id: Ic8a0362dd36d18930493a55699851161e9cb23e8
2015-03-13 12:21:26 -07:00
Dan Zivkovic eaa710d4aa Separate executor for the Spelling decoder.
Bug 19710676.

Change-Id: I6e66eddd507c11e424105869833fe6841b90275d
2015-03-12 17:10:38 -07:00
Dan Zivkovic 107fb4c476 Remove ALS from LatinIME.
This fixes unit tests and brings us closer to a green build.

Change-Id: Iffcc392eda4a7671a238b79cc7367320ca648725
2015-03-11 17:29:12 -07:00
Dan Zivkovic 77fd5dbf3e Remove dead code, including tests.
Change-Id: Id88b02b74bdfe4ca05b08181ceb6b34d5652fc0c
2015-03-10 17:22:41 -07:00
Chieu Nguyen 21a28abc6a Handle empty previous ngram context correctly.
Fixes bug where empty previous ngram context not at the
beginning of a sentence incorrectly returned the
beginning-of-sentence marker.

Bug: 19612336
Change-Id: I5ddf3408e20dcedf70487b85c983cd3fc12550e7
2015-03-09 19:02:43 -07:00