diff options
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputConnection.java | 4 | ||||
-rw-r--r-- | native/jni/HostUnitTests.mk | 8 | ||||
-rwxr-xr-x | native/jni/run-tests.sh | 7 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java | 1 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java | 1 | ||||
-rw-r--r-- | tools/dicttool/compat/com/android/inputmethod/latin/utils/WordInputEventForPersonalization.java (renamed from tools/dicttool/compat/com/android/inputmethod/latin/utils/LanguageModelParam.java) | 2 | ||||
-rw-r--r-- | tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java | 9 |
7 files changed, 18 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index be1523f63..69f0b3eb3 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -367,7 +367,9 @@ public final class RichInputConnection implements PrivateCommandPerformer { } // This never calls InputConnection#getCapsMode - in fact, it's a static method that // never blocks or initiates IPC. - return CapsModeUtils.getCapsMode(mCommittedTextBeforeComposingText, inputType, + // TODO: don't call #toString() here. Instead, all accesses to + // mCommittedTextBeforeComposingText should be done on the main thread. + return CapsModeUtils.getCapsMode(mCommittedTextBeforeComposingText.toString(), inputType, spacingAndPunctuations, hasSpaceBefore); } diff --git a/native/jni/HostUnitTests.mk b/native/jni/HostUnitTests.mk index 6967d9b87..40ec2558e 100644 --- a/native/jni/HostUnitTests.mk +++ b/native/jni/HostUnitTests.mk @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Host build is never supported in unbundled (NDK/tapas) build +ifeq (,$(TARGET_BUILD_APPS)) + # HACK: Temporarily disable host tool build on Mac until the build system is ready for C++11. LATINIME_HOST_OSNAME := $(shell uname -s) ifneq ($(LATINIME_HOST_OSNAME), Darwin) # TODO: Remove this @@ -47,10 +50,13 @@ LOCAL_SRC_FILES := $(addprefix $(LATIN_IME_TEST_SRC_DIR)/, $(LATIN_IME_CORE_TEST LOCAL_STATIC_LIBRARIES += liblatinime_host_static_for_unittests include $(BUILD_HOST_NATIVE_TEST) +include $(LOCAL_PATH)/CleanupNativeFileList.mk + endif # Darwin - TODO: Remove this +endif # TARGET_BUILD_APPS + #################### Clean up the tmp vars LATINIME_HOST_OSNAME := LATIN_IME_SRC_DIR := LATIN_IME_TEST_SRC_DIR := -include $(LOCAL_PATH)/CleanupNativeFileList.mk diff --git a/native/jni/run-tests.sh b/native/jni/run-tests.sh index 3da45270d..a7fa82d9b 100755 --- a/native/jni/run-tests.sh +++ b/native/jni/run-tests.sh @@ -48,6 +48,13 @@ if [[ $show_usage == yes ]]; then if [[ ${BASH_SOURCE[0]} != $0 ]]; then return; else exit 1; fi fi +# Host build is never supported in unbundled (NDK/tapas) build +if [[ $enable_host_test == yes && -n $TARGET_BUILD_APPS ]]; then + echo "Host build is never supported in tapas build." 1>&2 + echo "Use lunch command instead." 1>&2 + if [[ ${BASH_SOURCE[0]} != $0 ]]; then return; else exit 1; fi +fi + target_test_name=liblatinime_target_unittests host_test_name=liblatinime_host_unittests diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java index 8f3373cc2..47badc1f2 100644 --- a/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java +++ b/tests/src/com/android/inputmethod/latin/BinaryDictionaryDecayingTests.java @@ -40,7 +40,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; -import java.util.Map; import java.util.Random; import java.util.concurrent.TimeUnit; diff --git a/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java index 0f2fa2fb1..d0f4f390f 100644 --- a/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java +++ b/tests/src/com/android/inputmethod/latin/BinaryDictionaryTests.java @@ -36,7 +36,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; -import java.util.Map; import java.util.Random; // TODO Use the seed passed as an argument for makedict test. diff --git a/tools/dicttool/compat/com/android/inputmethod/latin/utils/LanguageModelParam.java b/tools/dicttool/compat/com/android/inputmethod/latin/utils/WordInputEventForPersonalization.java index f4ca94a81..b5a729421 100644 --- a/tools/dicttool/compat/com/android/inputmethod/latin/utils/LanguageModelParam.java +++ b/tools/dicttool/compat/com/android/inputmethod/latin/utils/WordInputEventForPersonalization.java @@ -16,5 +16,5 @@ package com.android.inputmethod.latin.utils; -public final class LanguageModelParam { +public final class WordInputEventForPersonalization { } diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java index e04751ddc..8f9e4a3a6 100644 --- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java +++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java @@ -27,7 +27,6 @@ import com.android.inputmethod.latin.makedict.UnsupportedFormatException; import com.android.inputmethod.latin.makedict.Ver2DictEncoder; import com.android.inputmethod.latin.makedict.Ver4DictEncoder; -import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; @@ -253,14 +252,6 @@ public class DictionaryMaker { } } - private static BufferedInputStream getBufferedFileInputStream(final String filename) - throws FileNotFoundException { - if (filename == null) { - return null; - } - return new BufferedInputStream(new FileInputStream(filename)); - } - /** * Invoke the right output method according to args. * |