diff options
author | 2013-12-03 15:42:59 +0900 | |
---|---|---|
committer | 2013-12-03 17:46:56 +0900 | |
commit | 25848af55647251d0ba882e1640d08dd1fce7875 (patch) | |
tree | 0b99d54ff460c65f1b9e177925b4bc9794ccdef4 /java/src | |
parent | b6764c51ab6acc8b5acf3ce3513e30c9ce82d02c (diff) | |
download | latinime-25848af55647251d0ba882e1640d08dd1fce7875.tar.gz latinime-25848af55647251d0ba882e1640d08dd1fce7875.tar.xz latinime-25848af55647251d0ba882e1640d08dd1fce7875.zip |
Tiny refactoring
Add a warning comment and make it so that openNative()
is only called in one place in the code.
Bug: 11281748
Change-Id: Ic7819a01deb62cf145ebf9d620da2d15fae19313
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionary.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 4fa682d66..174bbfb8e 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -376,7 +376,10 @@ public final class BinaryDictionary extends Dictionary { private void reopen() { close(); final File dictFile = new File(mDictFilePath); - mNativeDict = openNative(dictFile.getAbsolutePath(), 0 /* startOffset */, + // WARNING: Because we pass 0 as the offstet and file.length() as the length, this can + // only be called for actual files. Right now it's only called by the flush() family of + // functions, which require an updatable dictionary, so it's okay. But beware. + loadDictionary(dictFile.getAbsolutePath(), 0 /* startOffset */, dictFile.length(), true /* isUpdatable */); } |