diff options
Diffstat (limited to '')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java | 4 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/FormatSpec.java | 38 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/MakedictLog.java | 47 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java | 2 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java (renamed from java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java) | 3 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java (renamed from java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java (renamed from java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java) | 34 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/DictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/DictDecoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/DictEncoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java (renamed from java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/PendingAttribute.java (renamed from java/src/com/android/inputmethod/latin/makedict/PendingAttribute.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java (renamed from java/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java (renamed from java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java) | 0 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java (renamed from java/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java) | 0 |
18 files changed, 38 insertions, 90 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java index 7fff46aaf..7e2166769 100644 --- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java +++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java @@ -632,7 +632,9 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange } public void setHardwareAcceleratedDrawingEnabled(final boolean enabled) { - // TODO: + if (!enabled) return; + // TODO: Should use LAYER_TYPE_SOFTWARE when hardware acceleration is off? + setLayerType(LAYER_TYPE_HARDWARE, null); } private static void setupAlphabetKey(final TextView alphabetKey, final String label, diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java index 07217e48e..f25503488 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java @@ -18,9 +18,7 @@ package com.android.inputmethod.latin.makedict; import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.makedict.DictDecoder.DictionaryBufferFactory; -import java.io.File; import java.util.Date; import java.util.HashMap; @@ -363,42 +361,6 @@ public final class FormatSpec { } } - /** - * Returns new dictionary decoder. - * - * @param dictFile the dictionary file. - * @param offset the offset in the file. - * @param length the length of the file, in bytes. - * @param bufferType The type of buffer, as one of USE_* in DictDecoder. - * @return new dictionary decoder if the dictionary file exists, otherwise null. - */ - public static DictDecoder getDictDecoder(final File dictFile, final long offset, - final long length, final int bufferType) { - if (dictFile.isDirectory()) { - return new Ver4DictDecoder(dictFile, bufferType); - } else if (dictFile.isFile()) { - return new Ver2DictDecoder(dictFile, offset, length, bufferType); - } - return null; - } - - @UsedForTesting - public static DictDecoder getDictDecoder(final File dictFile, final long offset, - final long length, final DictionaryBufferFactory factory) { - if (dictFile.isDirectory()) { - return new Ver4DictDecoder(dictFile, factory); - } else if (dictFile.isFile()) { - return new Ver2DictDecoder(dictFile, offset, length, factory); - } - return null; - } - - @UsedForTesting - public static DictDecoder getDictDecoder(final File dictFile, final long offset, - final long length) { - return getDictDecoder(dictFile, offset, length, DictDecoder.USE_READONLY_BYTEBUFFER); - } - private FormatSpec() { // This utility class is not publicly instantiable. } diff --git a/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java b/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java deleted file mode 100644 index cf07209d9..000000000 --- a/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.latin.makedict; - -import android.util.Log; - -/** - * Wrapper to redirect log events to the right output medium. - */ -public final class MakedictLog { - public static final boolean DBG = false; - private static final String TAG = MakedictLog.class.getSimpleName(); - - public static void d(String message) { - if (DBG) { - Log.d(TAG, message); - } - } - - public static void i(String message) { - if (DBG) { - Log.i(TAG, message); - } - } - - public static void w(String message) { - Log.w(TAG, message); - } - - public static void e(String message) { - Log.e(TAG, message); - } -} diff --git a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java index e531d4b09..315913e2f 100644 --- a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java @@ -23,12 +23,10 @@ import android.content.res.Resources; import android.text.TextUtils; import android.util.Log; -import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.latin.AssetFileAddress; import com.android.inputmethod.latin.BinaryDictionaryGetter; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.makedict.BinaryDictIOUtils; import com.android.inputmethod.latin.makedict.DictionaryHeader; import com.android.inputmethod.latin.makedict.UnsupportedFormatException; import com.android.inputmethod.latin.settings.SpacingAndPunctuations; diff --git a/java/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java index bc856f113..bc856f113 100644 --- a/java/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/AbstractDictDecoder.java diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java index b534bcb09..6f8b07a34 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderUtils.java @@ -28,7 +28,6 @@ import java.nio.ByteBuffer; * * All the methods in this class are static. * - * TODO: Remove calls from classes except Ver3DictDecoder * TODO: Move this file to makedict/internal. * TODO: Rename this class to DictDecoderUtils. */ @@ -356,7 +355,7 @@ public final class BinaryDictDecoderUtils { * @return true if it's a binary dictionary, false otherwise */ public static boolean isBinaryDictionary(final File file) { - final DictDecoder dictDecoder = FormatSpec.getDictDecoder(file, 0, file.length()); + final DictDecoder dictDecoder = BinaryDictIOUtils.getDictDecoder(file, 0, file.length()); if (dictDecoder == null) { return false; } diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java index 39bd98bad..39bd98bad 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java index a180f1c29..42a50be66 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java @@ -18,7 +18,9 @@ package com.android.inputmethod.latin.makedict; import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.makedict.DictDecoder.DictionaryBufferFactory; +import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; @@ -32,6 +34,38 @@ public final class BinaryDictIOUtils { // This utility class is not publicly instantiable. } + /** + * Returns new dictionary decoder. + * + * @param dictFile the dictionary file. + * @param bufferType The type of buffer, as one of USE_* in DictDecoder. + * @return new dictionary decoder if the dictionary file exists, otherwise null. + */ + public static DictDecoder getDictDecoder(final File dictFile, final long offset, + final long length, final int bufferType) { + if (dictFile.isDirectory()) { + return new Ver4DictDecoder(dictFile, bufferType); + } else if (dictFile.isFile()) { + return new Ver2DictDecoder(dictFile, offset, length, bufferType); + } + return null; + } + + public static DictDecoder getDictDecoder(final File dictFile, final long offset, + final long length, final DictionaryBufferFactory factory) { + if (dictFile.isDirectory()) { + return new Ver4DictDecoder(dictFile, factory); + } else if (dictFile.isFile()) { + return new Ver2DictDecoder(dictFile, offset, length, factory); + } + return null; + } + + public static DictDecoder getDictDecoder(final File dictFile, final long offset, + final long length) { + return getDictDecoder(dictFile, offset, length, DictDecoder.USE_READONLY_BYTEBUFFER); + } + private static final class Position { public static final int NOT_READ_PTNODE_COUNT = -1; diff --git a/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/DictDecoder.java index a3b28a702..a3b28a702 100644 --- a/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/DictDecoder.java diff --git a/java/src/com/android/inputmethod/latin/makedict/DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java index 678c5ca6b..678c5ca6b 100644 --- a/java/src/com/android/inputmethod/latin/makedict/DictEncoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/DictEncoder.java diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java index f60b3af4f..f60b3af4f 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java +++ b/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java diff --git a/java/src/com/android/inputmethod/latin/makedict/PendingAttribute.java b/tests/src/com/android/inputmethod/latin/makedict/PendingAttribute.java index 70e24cc98..70e24cc98 100644 --- a/java/src/com/android/inputmethod/latin/makedict/PendingAttribute.java +++ b/tests/src/com/android/inputmethod/latin/makedict/PendingAttribute.java diff --git a/java/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java b/tests/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java index 862e8c101..862e8c101 100644 --- a/java/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java +++ b/tests/src/com/android/inputmethod/latin/makedict/PtNodeInfo.java diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java index 7091c119e..7091c119e 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java index a286190cb..a286190cb 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java index f3fad7e99..f3fad7e99 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java index dab9a4315..dab9a4315 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java +++ b/tests/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java diff --git a/java/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java b/tests/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java index 2028298f2..2028298f2 100644 --- a/java/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java +++ b/tests/src/com/android/inputmethod/latin/utils/ByteArrayDictBuffer.java |