History log of /packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5c32b6da4400c85db2245de3bc18c91d495ce1c5 13-Nov-2012 Jean Chalard <jchalard@google.com> Make sure all FDs are correctly closed.

In this kind of series of calls, it's possible that an outer call to a
constructor fails, but the inner succeeded.
Example:
try {
is = new A(new B());
} finally {
if (null != is) is.close();
}
In this case, if new B() succeeds but new A() throws an
exception, is stays null and the intermediate object is never
closed. This is what was happening in this instance.

Bug: 7377336
Change-Id: I3fae9fec1135244982fcf5098c76d93f3e0f2add
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
66c90cd2ae49c49da8aeda5ab1d86bd9b76434c7 11-Oct-2012 Jean Chalard <jchalard@google.com> Put temporary files under a separate directory.

Bug: 7328003
Change-Id: Ibe5278ea209d149f87fd08785c77b17e3859948e
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
c15726482eee1fe9eb5c84e337ae5d40735da2d3 04-Oct-2012 Jean Chalard <jchalard@google.com> Unlink an old file before moving the new file over it

This is unlikely to be relevant to this bug, but just in case.

Bug: 7274972
Change-Id: I56b31b377af16cc2c15ceb90a19792bed3aab367
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
a28a05e971cc242b338331a3b78276fa95188d19 27-Sep-2012 Tadashi G. Takaoka <takaoka@google.com> Cleanup: Make some classes as final

Change-Id: I6009b3c1950ba32b7f1e205a3db2307fe0cd688e
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
5f282ea9e4a4590fcbab6e27d5fca7dacbb40a6a 21-Aug-2012 Tadashi G. Takaoka <takaoka@google.com> Add CollectionUtils class to create generic collection easily

Change-Id: I6b4de9187e122298e5e9cd8ddc9070d062df6a89
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
4bcf70c93106f17e3119fcb4c7ec9eaff6d54e4c 04-Jul-2012 Jean Chalard <jchalard@google.com> Fix a bad interaction with mmap

Bug: 6761221
Change-Id: I7e6d98dc9d7cb34a6163c3957e401ff97abb975c
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
3abac7e28e9fbfc96b146abc0028fb5a2a5973da 23-May-2012 Jean Chalard <jchalard@google.com> Notify the dictionary pack about copy failures

Bug: 6532896
Change-Id: I57f7b1a400222c89776f9bff652a7da4470232c5
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
b9e2bce95e955b6393c25226ab62fa44d24b904a 23-May-2012 Jean Chalard <jchalard@google.com> Remove an updated dictionary that changed locales

When a dictionary changes locale, we need to remove the file
that corresponds to the old version. It has a different path
than the new one, so we have to search for it explicitly.

Bug: 6540631
Change-Id: Ie9d63ba636651fe90f8fbb9627b7265ac7b34ccd
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
04b03f4dd63a6cc5ea1b4d6afc93c442b907b282 20-Apr-2012 Jean Chalard <jchalard@google.com> Allow using a format version 2 word list in LatinIME

Change-Id: I73a4df3a83e49be6e8d3a7d14eb027cfe10f1a23
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
cec8552b18fd74517512a43a8d75f64e64bd12c3 11-Apr-2012 Jean Chalard <jchalard@google.com> Pass a parameter to the dict pack if we don't have a default dict

Also, optimize quite a bit the code that decides whether we have
a default dict or not.

Bug: 5705834
Change-Id: Ied20fbcbbc42cbe8c01759d11b1804d1156c6960
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
c61cd79229b1871d0f603a23389695d7f7751e66 29-Mar-2012 Tadashi G. Takaoka <takaoka@google.com> Fix some obvious compiler warnings

Change-Id: I10a634f7492b45d5a72345f14d36cf341946387d
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
bc89f5d3a5a2771b56643e1b9c47744268fff3a6 21-Mar-2012 Jean Chalard <jchalard@google.com> Correctly close the gzip stream

I had gotten the chain call in reverse.
Bug: 6177523

Change-Id: Ic5b76425de2d5d05d5132f8d2c7ade0d79c14ccc
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
ab72a97d7ce44230a0c824797d1675a5ca354a56 04-Oct-2011 Tadashi G. Takaoka <takaoka@google.com> Cleanup unused import

This change also gets rid of several compiler warnings.

Change-Id: I23962edaadad18a6e0395d528af17b909dcf5dad
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
7a408431fe6b77bc7a317b86c7adfb1aeebd5def 30-Aug-2011 Jean Chalard <jchalard@google.com> Check the magic number of a decoded file

Checking the magic number of a file upon decoding is necessary,
because if the file is corrupt and we don't check it, we will
fall back to a simple copy of the corrupted file. Latin IME
would realize this and would not crash, but would not use the
corrupted dictionary. If this happened to be a main dictionary,
then the user would lose the ability to use the correct
built-in dictionary.

Not the same, but kinda similar to
Bug: 5223031

Change-Id: Ic2783dc9dd5f3dcf2865623d9452765fe3778db7
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
de4e8dedccc7b6db6df4c3f75d9f2458432c558a 25-Aug-2011 Jean Chalard <jchalard@google.com> Allow sharing dictionaries between similar locales.

Bug: 5058488
Change-Id: Ib12013f58afad957a8205b439f87480cc12ea06f
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
a16621ada43c7b499857bc8967e454994098bff3 24-Aug-2011 Jean Chalard <jchalard@google.com> Add a debug variable

...that was missing

Change-Id: Ia3b17909f295e0a93dee633c8d67c0e03840023e
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
20973de72b8e3ba607d17e50bb4fbc3cc815a6eb 24-Aug-2011 Jean Chalard <jchalard@google.com> Avoid unnecessary output to the system log.

The message this removes gets printed under normal conditions.
Normally dictionary files are compressed then crypted, but not
compressed a second time; however LatinIME tries to open a
compressed-crypted-compressed file first, because it could not
do it afterwards and we want to support this case. So under
normal operations, the first method LatinIME tries is actually
expected to fail.
Also, if we decide to stop compressing or/and encrypting dicts
LatinIME supports it as a valid use case. It should not print
errors to the log.

If the file cannot be open at all, then it is an unexpected
case, and Latin IME still reports to the log.

Change-Id: Ic5228c51365a101af1d03e2c893484d3050b5a1c
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
38d512c0b24f3e5ce595e0b4b9092f84af380517 24-Aug-2011 Jean Chalard <jchalard@google.com> Call the decrypt/unzip routines upon copying a dictionary.

Bug: 5095140
Change-Id: I7000f752bc9b7fd6a7af4839b2f225c085300128
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
7b1f74bb9ddae952f4da6c8d9bbb0057984b0988 23-Aug-2011 Jean Chalard <jchalard@google.com> Refactoring: cut out a method for caching a word list

This is preparation to have the decrypting/unzipping code
moved over to LatinIME.

Bug: 5095140
Change-Id: Ic3fdcc3de673b46cef2eb9ebe6a52cbdd614e50a
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
80e0bf04292867ddc769aca75ebaee817b95a941 16-Aug-2011 Jean Chalard <jchalard@google.com> Exception refactoring

Now that the dictionary pack can return several files, it's better
to handle IO exceptions for each file rather than globally. This
also will help with next implementation steps.

Bug: 5095140
Change-Id: I5ed135ad2ad4f55f61f9b3f92c48a35d5c24bdb2
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
28966734619251f78812f6a53f5efacbf5f77c49 11-Aug-2011 Jean Chalard <jchalard@google.com> Rename a function and update a comment

Bug: 5095140
Change-Id: Idf66a04c6a1a05015f94187a8dbce3d443bbf38b
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
5774908bb30db63f912ae588caebf257251884c8 10-Aug-2011 Jean Chalard <jchalard@google.com> Give the orders to delete the source files to the dict pack

Bug: 5095140
Change-Id: I64552861768ca30073ffe0d631b2e0c44dad4aa9
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
d4c08d9be3540466c8253ee02fecf4b6035d8ee0 10-Aug-2011 Jean Chalard <jchalard@google.com> Make sure the directory where to put files actually exists

Bug: 5095140
Change-Id: I764471e54ce0bf6aefe5d604cee97639d5ad0af9
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
3a22708e653193ee42d197c8fddbde87ea85d2d5 08-Aug-2011 Jean Chalard <jchalard@google.com> Have Latin IME copy files from the dictionary pack.

Also some minor cleanup: remove unused methods, minor refactoring into methods.

Bug: 5095140
Change-Id: I035537b37a31adfc8db3b933fb0cefcf703d6c7c
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
fae8d60ee926e9f340392789119cf81655ad46e9 02-Aug-2011 Jean Chalard <jchalard@google.com> Change the dictionary file passing schema to a list of ids

The dictionary filename used to be passed directly to Latin IME.
This change implements, on the part of Latin IME, the passing of
them as an id that should then be passed through
openAssetFileDescriptor.

Bug: 5095140
Change-Id: I7d1e9d57c19f0645045368f68681680f238189fc
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
d3da6e631111aaaa66d5988beafb7e95e7656c2d 26-Jul-2011 Jean Chalard <jchalard@google.com> Close a multiprocess file handle.

Bug: 5034192
Change-Id: I9c3d757cfae313e9b7510e167de797a74c74a351
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
e150ef98569d61078e0f8c67ded8364a9c3d4a20 21-Jul-2011 Jean Chalard <jchalard@google.com> Set the locale for opening an asset

This is necessary because we don't know any more whether the
locale of the process is the expected one when the dictionary
is loaded asynchronously.

Bug: 5023141
Change-Id: Ia9e4741f3b4a04a9f085f5b65ec122471b0c2dff
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
d8f52a4f18d22aa150846b01017410ce70bbad6f 27-Apr-2011 Jean Chalard <jchalard@google.com> Improve the architecture to support multiple dictionaries.

This change enables the interface to get multiple dictionaries from a
dictionary pack. It only implements it to the end in the case of the
proprietary method, as the open method needs still some working out,
and the "inside the package" method does not need it.

This change goes together with Iaa95bf36, and breaks the build
without it.

Bug: 1752028

Change-Id: I3ccfd696e8ef083ef9c074e1c3e4bb0bf2fcfd23
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
4e3bd58b862afadd0325746b5c7ca9145b771762 15-Apr-2011 Jean Chalard <jchalard@google.com> Allow use of assets for data in the dictionary content provider.

This update is necessary to allow dictionary content providers to use
assets, which are part of their apk, as data to pass to the keyboard.
Using plain file descriptors doesn't allow for sections of files to
be correctly used.

Change-Id: Ia94c26d6387bce61c73d38f5c2821f20e50e54d4
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
cba93f50c3d46ada773ec49435689dc3e2094385 14-Mar-2011 Jean Chalard <jchalard@google.com> Add different ways of reading the dictionary file.

This change adds basic support for an external dictionary provider.
It adds methods for reading the dictionary itself from an asset in
the dictionary provider package directly, obtaining the file name
through the ContentProvider interface; it also adds a way of getting
the data through an InputStream and copying the file locally.

Incidentally this change also adds the code needed to listen for
updating the dictionary provider package and reloading it in time.

This change also goes hand-in-hand with Iab31db6e, which implements
the small closed part of this.

Issue: 3414944

Change-Id: I5e4fff99a59bb99dbdb002102db6c90e6cb41c8a
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java