aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/res/values-sw430dp/config-per-form-factor.xml (renamed from java/res/values-sw540dp/config-per-form-factor.xml)9
-rw-r--r--java/res/values-sw430dp/config-screen-metrics.xml (renamed from java/res/values-sw540dp/config-screen-metrics.xml)0
-rw-r--r--java/res/values-sw600dp-land/config.xml (renamed from java/res/values-sw540dp-land/config.xml)4
-rw-r--r--java/res/values-sw600dp/config-per-form-factor.xml1
-rw-r--r--java/res/values-sw600dp/config.xml (renamed from java/res/values-sw540dp/config.xml)2
-rw-r--r--java/res/values-sw600dp/touch-position-correction.xml (renamed from java/res/values-sw540dp/touch-position-correction.xml)0
-rw-r--r--java/res/values-sw768dp-land/config.xml2
-rw-r--r--java/res/values-sw768dp/config-per-form-factor.xml1
-rw-r--r--java/src/com/android/inputmethod/keyboard/PointerTracker.java7
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/TimerHandler.java22
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FormatSpec.java1
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java2
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java3
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java28
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java12
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java16
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java3
17 files changed, 56 insertions, 57 deletions
diff --git a/java/res/values-sw540dp/config-per-form-factor.xml b/java/res/values-sw430dp/config-per-form-factor.xml
index 7f898e017..8868081c3 100644
--- a/java/res/values-sw540dp/config-per-form-factor.xml
+++ b/java/res/values-sw430dp/config-per-form-factor.xml
@@ -20,13 +20,14 @@
<!-- Configuration values for Large Phone. -->
<resources>
- <bool name="config_enable_show_key_preview_popup_option">false</bool>
+ <bool name="config_enable_show_key_preview_popup_option">true</bool>
<!-- Whether or not Popup on key press is enabled by default -->
- <bool name="config_default_key_preview_popup">false</bool>
- <bool name="config_default_sound_enabled">true</bool>
+ <bool name="config_default_key_preview_popup">true</bool>
+ <bool name="config_default_sound_enabled">false</bool>
<bool name="config_enable_show_voice_key_option">true</bool>
- <bool name="config_key_selection_by_dragging_finger">false</bool>
+ <bool name="config_key_selection_by_dragging_finger">true</bool>
<!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if
false -->
<bool name="config_show_more_keys_keyboard_at_touched_point">false</bool>
+ <bool name="config_use_fullscreen_mode">false</bool>
</resources>
diff --git a/java/res/values-sw540dp/config-screen-metrics.xml b/java/res/values-sw430dp/config-screen-metrics.xml
index 1205aaa1e..1205aaa1e 100644
--- a/java/res/values-sw540dp/config-screen-metrics.xml
+++ b/java/res/values-sw430dp/config-screen-metrics.xml
diff --git a/java/res/values-sw540dp-land/config.xml b/java/res/values-sw600dp-land/config.xml
index f4785e721..bd123c499 100644
--- a/java/res/values-sw540dp-land/config.xml
+++ b/java/res/values-sw600dp-land/config.xml
@@ -18,10 +18,8 @@
*/
-->
-<!-- Configuration values for Large Phone and Small Tablet Landscape. -->
+<!-- Configuration values for Small Tablet Landscape. -->
<resources>
- <bool name="config_use_fullscreen_mode">false</bool>
-
<!-- Preferable keyboard height in absolute scale: 45.0mm -->
<!-- This config_default_keyboard_height value should match with keyboard-heights.xml -->
<dimen name="config_default_keyboard_height">283.5dp</dimen>
diff --git a/java/res/values-sw600dp/config-per-form-factor.xml b/java/res/values-sw600dp/config-per-form-factor.xml
index 1c7e677a9..aa9a05482 100644
--- a/java/res/values-sw600dp/config-per-form-factor.xml
+++ b/java/res/values-sw600dp/config-per-form-factor.xml
@@ -29,4 +29,5 @@
<!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if
false -->
<bool name="config_show_more_keys_keyboard_at_touched_point">false</bool>
+ <bool name="config_use_fullscreen_mode">false</bool>
</resources>
diff --git a/java/res/values-sw540dp/config.xml b/java/res/values-sw600dp/config.xml
index 8637d6bab..700350c36 100644
--- a/java/res/values-sw540dp/config.xml
+++ b/java/res/values-sw600dp/config.xml
@@ -18,7 +18,7 @@
*/
-->
-<!-- Configuration values for Large Phone and Small Tablet Portrait. -->
+<!-- Configuration values for Small Tablet Portrait. -->
<resources>
<dimen name="config_key_hysteresis_distance">40.0dp</dimen>
diff --git a/java/res/values-sw540dp/touch-position-correction.xml b/java/res/values-sw600dp/touch-position-correction.xml
index 932b8fc72..932b8fc72 100644
--- a/java/res/values-sw540dp/touch-position-correction.xml
+++ b/java/res/values-sw600dp/touch-position-correction.xml
diff --git a/java/res/values-sw768dp-land/config.xml b/java/res/values-sw768dp-land/config.xml
index b97872f54..4040e29f7 100644
--- a/java/res/values-sw768dp-land/config.xml
+++ b/java/res/values-sw768dp-land/config.xml
@@ -20,8 +20,6 @@
<!-- Configuration values for Large Tablet Landscape. -->
<resources>
- <bool name="config_use_fullscreen_mode">false</bool>
-
<!-- Preferable keyboard height in absolute scale: 58.0mm -->
<!-- This config_default_keyboard_height value should match with keyboard-heights.xml -->
<dimen name="config_default_keyboard_height">365.4dp</dimen>
diff --git a/java/res/values-sw768dp/config-per-form-factor.xml b/java/res/values-sw768dp/config-per-form-factor.xml
index 136f41567..b90fbaea5 100644
--- a/java/res/values-sw768dp/config-per-form-factor.xml
+++ b/java/res/values-sw768dp/config-per-form-factor.xml
@@ -29,4 +29,5 @@
<!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if
false -->
<bool name="config_show_more_keys_keyboard_at_touched_point">true</bool>
+ <bool name="config_use_fullscreen_mode">false</bool>
</resources>
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index f9e78bfd9..a2528e046 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -70,6 +70,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
public void startKeyRepeatTimerOf(PointerTracker tracker, int repeatCount, int delay);
public void startLongPressTimerOf(PointerTracker tracker, int delay);
public void cancelLongPressTimerOf(PointerTracker tracker);
+ public void cancelLongPressShiftKeyTimers();
public void cancelKeyTimersOf(PointerTracker tracker);
public void startDoubleTapShiftKeyTimer();
public void cancelDoubleTapShiftKeyTimer();
@@ -90,6 +91,8 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
@Override
public void cancelLongPressTimerOf(PointerTracker tracker) {}
@Override
+ public void cancelLongPressShiftKeyTimers() {}
+ @Override
public void cancelKeyTimersOf(PointerTracker tracker) {}
@Override
public void startDoubleTapShiftKeyTimer() {}
@@ -1338,6 +1341,9 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
}
private void startLongPressTimer(final Key key) {
+ // Note that we need to cancel all active long press shift key timers if any whenever we
+ // start a new long press timer for both non-shift and shift keys.
+ sTimerProxy.cancelLongPressShiftKeyTimers();
if (sInGesture) return;
if (key == null) return;
if (!key.isLongPressEnabled()) return;
@@ -1349,6 +1355,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
if (mIsInDraggingFinger && key.getMoreKeys() == null) return;
final int delay = getLongPressTimeout(key.getCode());
+ if (delay <= 0) return;
sTimerProxy.startLongPressTimerOf(this, delay);
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/TimerHandler.java b/java/src/com/android/inputmethod/keyboard/internal/TimerHandler.java
index 88d0878d1..3298a3f24 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/TimerHandler.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/TimerHandler.java
@@ -38,8 +38,9 @@ public final class TimerHandler extends LeakGuardHandlerWrapper<Callbacks> imple
private static final int MSG_TYPING_STATE_EXPIRED = 0;
private static final int MSG_REPEAT_KEY = 1;
private static final int MSG_LONGPRESS_KEY = 2;
- private static final int MSG_DOUBLE_TAP_SHIFT_KEY = 3;
- private static final int MSG_UPDATE_BATCH_INPUT = 4;
+ private static final int MSG_LONGPRESS_SHIFT_KEY = 3;
+ private static final int MSG_DOUBLE_TAP_SHIFT_KEY = 4;
+ private static final int MSG_UPDATE_BATCH_INPUT = 5;
private final int mIgnoreAltCodeKeyTimeout;
private final int mGestureRecognitionUpdateTime;
@@ -66,6 +67,7 @@ public final class TimerHandler extends LeakGuardHandlerWrapper<Callbacks> imple
tracker.onKeyRepeat(msg.arg1 /* code */, msg.arg2 /* repeatCount */);
break;
case MSG_LONGPRESS_KEY:
+ case MSG_LONGPRESS_SHIFT_KEY:
cancelLongPressTimers();
callbacks.onLongPress(tracker);
break;
@@ -102,19 +104,31 @@ public final class TimerHandler extends LeakGuardHandlerWrapper<Callbacks> imple
@Override
public void startLongPressTimerOf(final PointerTracker tracker, final int delay) {
- if (delay <= 0) {
+ final Key key = tracker.getKey();
+ if (key == null) {
return;
}
- sendMessageDelayed(obtainMessage(MSG_LONGPRESS_KEY, tracker), delay);
+ // Use a separate message id for long pressing shift key, because long press shift key
+ // timers should be canceled when other key is pressed.
+ final int messageId = (key.getCode() == Constants.CODE_SHIFT)
+ ? MSG_LONGPRESS_SHIFT_KEY : MSG_LONGPRESS_KEY;
+ sendMessageDelayed(obtainMessage(messageId, tracker), delay);
}
@Override
public void cancelLongPressTimerOf(final PointerTracker tracker) {
removeMessages(MSG_LONGPRESS_KEY, tracker);
+ removeMessages(MSG_LONGPRESS_SHIFT_KEY, tracker);
+ }
+
+ @Override
+ public void cancelLongPressShiftKeyTimers() {
+ removeMessages(MSG_LONGPRESS_SHIFT_KEY);
}
private void cancelLongPressTimers() {
removeMessages(MSG_LONGPRESS_KEY);
+ removeMessages(MSG_LONGPRESS_SHIFT_KEY);
}
@Override
diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
index d7c523f3c..af54805f7 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
@@ -188,7 +188,6 @@ public final class FormatSpec {
// us to change the format during development while having testing devices remove
// older files with each upgrade, while still having a readable versioning scheme.
public static final int VERSION2 = 2;
- public static final int VERSION3 = 3;
public static final int VERSION4 = 400;
static final int MINIMUM_SUPPORTED_VERSION = VERSION2;
static final int MAXIMUM_SUPPORTED_VERSION = VERSION4;
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java
index 665544228..e5430423d 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java
+++ b/java/src/com/android/inputmethod/latin/makedict/Ver2DictEncoder.java
@@ -68,7 +68,7 @@ public class Ver2DictEncoder implements DictEncoder {
@Override
public void writeDictionary(final FusionDictionary dict, final FormatOptions formatOptions)
throws IOException, UnsupportedFormatException {
- if (formatOptions.mVersion > FormatSpec.VERSION3) {
+ if (formatOptions.mVersion > FormatSpec.VERSION2) {
throw new UnsupportedFormatException(
"The given format options has wrong version number : "
+ formatOptions.mVersion);
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
index a746f9945..8eaee4d9f 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
+++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java
@@ -56,7 +56,8 @@ public class Ver4DictEncoder implements DictEncoder {
}
if (!BinaryDictionary.createEmptyDictFile(mDictPlacedDir.getAbsolutePath(),
FormatSpec.VERSION4, dict.mOptions.mAttributes)) {
- throw new IOException("Cannot create dictionary file");
+ throw new IOException("Cannot create dictionary file : "
+ + mDictPlacedDir.getAbsolutePath());
}
final BinaryDictionary binaryDict = new BinaryDictionary(mDictPlacedDir.getAbsolutePath(),
0l, mDictPlacedDir.length(), true /* useFullEditDistance */,
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
index aff045c2b..f52f5e73c 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
@@ -169,8 +169,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
long now = -1, diff = -1;
try {
- final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions,
- getContext().getCacheDir());
+ final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions);
now = System.currentTimeMillis();
// If you need to dump the dict to a textual file, uncomment the line below and the
@@ -316,7 +315,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
runReadAndWriteTests(results, BinaryDictUtils.USE_BYTE_BUFFER,
BinaryDictUtils.VERSION2_OPTIONS);
runReadAndWriteTests(results, BinaryDictUtils.USE_BYTE_BUFFER,
- BinaryDictUtils.VERSION3_OPTIONS);
+ BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runReadAndWriteTests(results, BinaryDictUtils.USE_BYTE_BUFFER,
BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
@@ -331,7 +330,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
runReadAndWriteTests(results, BinaryDictUtils.USE_BYTE_ARRAY,
BinaryDictUtils.VERSION2_OPTIONS);
runReadAndWriteTests(results, BinaryDictUtils.USE_BYTE_ARRAY,
- BinaryDictUtils.VERSION3_OPTIONS);
+ BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runReadAndWriteTests(results, BinaryDictUtils.USE_BYTE_ARRAY,
BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
@@ -390,8 +389,6 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
private long timeAndCheckReadUnigramsAndBigramsBinary(final File file, final List<String> words,
final SparseArray<List<Integer>> bigrams, final int bufferType) {
- FileInputStream inStream = null;
-
final TreeMap<Integer, String> resultWords = CollectionUtils.newTreeMap();
final TreeMap<Integer, ArrayList<PendingAttribute>> resultBigrams =
CollectionUtils.newTreeMap();
@@ -407,14 +404,6 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
Log.e(TAG, "IOException", e);
} catch (UnsupportedFormatException e) {
Log.e(TAG, "UnsupportedFormatException", e);
- } finally {
- if (inStream != null) {
- try {
- inStream.close();
- } catch (IOException e) {
- // do nothing
- }
- }
}
checkWordMap(words, bigrams, resultWords, resultFreqs, resultBigrams);
@@ -461,7 +450,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
runReadUnigramsAndBigramsTests(results, BinaryDictUtils.USE_BYTE_BUFFER,
BinaryDictUtils.VERSION2_OPTIONS);
runReadUnigramsAndBigramsTests(results, BinaryDictUtils.USE_BYTE_BUFFER,
- BinaryDictUtils.VERSION3_OPTIONS);
+ BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runReadUnigramsAndBigramsTests(results, BinaryDictUtils.USE_BYTE_BUFFER,
BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
@@ -476,7 +465,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
runReadUnigramsAndBigramsTests(results, BinaryDictUtils.USE_BYTE_ARRAY,
BinaryDictUtils.VERSION2_OPTIONS);
runReadUnigramsAndBigramsTests(results, BinaryDictUtils.USE_BYTE_ARRAY,
- BinaryDictUtils.VERSION3_OPTIONS);
+ BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runReadUnigramsAndBigramsTests(results, BinaryDictUtils.USE_BYTE_ARRAY,
BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
@@ -590,14 +579,14 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
runGetTerminalPositionTests(BinaryDictUtils.USE_BYTE_ARRAY,
BinaryDictUtils.VERSION2_OPTIONS);
runGetTerminalPositionTests(BinaryDictUtils.USE_BYTE_ARRAY,
- BinaryDictUtils.VERSION3_OPTIONS);
+ BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runGetTerminalPositionTests(BinaryDictUtils.USE_BYTE_ARRAY,
BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
runGetTerminalPositionTests(BinaryDictUtils.USE_BYTE_BUFFER,
BinaryDictUtils.VERSION2_OPTIONS);
runGetTerminalPositionTests(BinaryDictUtils.USE_BYTE_BUFFER,
- BinaryDictUtils.VERSION3_OPTIONS);
+ BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runGetTerminalPositionTests(BinaryDictUtils.USE_BYTE_BUFFER,
BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
@@ -633,6 +622,7 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
public void testDeleteWord() throws IOException, UnsupportedFormatException {
- runTestDeleteWord(BinaryDictUtils.VERSION3_OPTIONS);
+ runTestDeleteWord(BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
+ runTestDeleteWord(BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
}
}
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java
index ba1b6b33c..9ed50c4b3 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java
@@ -237,8 +237,7 @@ public class BinaryDictIOUtilsTests extends AndroidTestCase {
dict.add("abcd", 10, null, false);
try {
- final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions,
- getContext().getCacheDir());
+ final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions);
dictEncoder.writeDictionary(dict, formatOptions);
} catch (IOException e) {
fail("IOException while writing an initial dictionary : " + e);
@@ -289,7 +288,6 @@ public class BinaryDictIOUtilsTests extends AndroidTestCase {
}
public void testInsertWord() {
- runTestInsertWord(BinaryDictUtils.VERSION3_OPTIONS);
runTestInsertWord(BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runTestInsertWord(BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
}
@@ -307,8 +305,7 @@ public class BinaryDictIOUtilsTests extends AndroidTestCase {
dict.add("efgh", 15, null, false);
try {
- final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions,
- getContext().getCacheDir());
+ final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions);
dictEncoder.writeDictionary(dict, formatOptions);
} catch (IOException e) {
fail("IOException while writing an initial dictionary : " + e);
@@ -330,7 +327,6 @@ public class BinaryDictIOUtilsTests extends AndroidTestCase {
}
public void testInsertWordWithBigrams() {
- runTestInsertWordWithBigrams(BinaryDictUtils.VERSION3_OPTIONS);
runTestInsertWordWithBigrams(BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runTestInsertWordWithBigrams(BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
}
@@ -347,8 +343,7 @@ public class BinaryDictIOUtilsTests extends AndroidTestCase {
dict.add("initial", 10, null, false);
try {
- final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions,
- getContext().getCacheDir());
+ final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions);
dictEncoder.writeDictionary(dict, formatOptions);
} catch (IOException e) {
assertTrue(false);
@@ -379,7 +374,6 @@ public class BinaryDictIOUtilsTests extends AndroidTestCase {
}
public void testRandomWords() {
- runTestRandomWords(BinaryDictUtils.VERSION3_OPTIONS);
runTestRandomWords(BinaryDictUtils.VERSION4_OPTIONS_WITHOUT_TIMESTAMP);
runTestRandomWords(BinaryDictUtils.VERSION4_OPTIONS_WITH_TIMESTAMP);
}
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java
index a568704b4..67d77e05a 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictUtils.java
@@ -31,8 +31,6 @@ public class BinaryDictUtils {
public static final FormatSpec.FormatOptions VERSION2_OPTIONS =
new FormatSpec.FormatOptions(FormatSpec.VERSION2);
- public static final FormatSpec.FormatOptions VERSION3_OPTIONS =
- new FormatSpec.FormatOptions(FormatSpec.VERSION3);
public static final FormatSpec.FormatOptions VERSION4_OPTIONS_WITHOUT_TIMESTAMP =
new FormatSpec.FormatOptions(FormatSpec.VERSION4, false /* hasTimestamp */);
public static final FormatSpec.FormatOptions VERSION4_OPTIONS_WITH_TIMESTAMP =
@@ -48,8 +46,7 @@ public class BinaryDictUtils {
public static File getDictFile(final String name, final String version,
final FormatOptions formatOptions, final File directory) {
- if (formatOptions.mVersion == FormatSpec.VERSION2
- || formatOptions.mVersion == FormatSpec.VERSION3) {
+ if (formatOptions.mVersion == FormatSpec.VERSION2) {
return new File(directory, name + "." + version + TEST_DICT_FILE_EXTENSION);
} else if (formatOptions.mVersion == FormatSpec.VERSION4) {
return new File(directory, name + "." + version);
@@ -59,12 +56,13 @@ public class BinaryDictUtils {
}
}
- public static DictEncoder getDictEncoder(final File file, final FormatOptions formatOptions,
- final File cacheDir) {
+ public static DictEncoder getDictEncoder(final File file, final FormatOptions formatOptions) {
if (formatOptions.mVersion == FormatSpec.VERSION4) {
- return new Ver4DictEncoder(cacheDir);
- } else if (formatOptions.mVersion == FormatSpec.VERSION3
- || formatOptions.mVersion == FormatSpec.VERSION2) {
+ if (!file.isDirectory()) {
+ file.mkdir();
+ }
+ return new Ver4DictEncoder(file);
+ } else if (formatOptions.mVersion == FormatSpec.VERSION2) {
return new Ver2DictEncoder(file);
} else {
throw new RuntimeException("The format option has a wrong version : "
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 eb419fc28..143bce5ac 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java
@@ -46,7 +46,6 @@ public class DictionaryMaker {
static class Arguments {
private static final String OPTION_VERSION_2 = "-2";
- private static final String OPTION_VERSION_3 = "-3";
private static final String OPTION_VERSION_4 = "-4";
private static final String OPTION_INPUT_SOURCE = "-s";
private static final String OPTION_INPUT_BIGRAM_XML = "-b";
@@ -158,8 +157,6 @@ public class DictionaryMaker {
if (arg.charAt(0) == '-') {
if (OPTION_VERSION_2.equals(arg)) {
// Do nothing, this is the default
- } else if (OPTION_VERSION_3.equals(arg)) {
- outputBinaryFormatVersion = FormatSpec.VERSION3;
} else if (OPTION_VERSION_4.equals(arg)) {
outputBinaryFormatVersion = FormatSpec.VERSION4;
} else if (OPTION_HELP.equals(arg)) {