aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-05-21 12:45:54 +0900
committerJean Chalard <jchalard@google.com>2014-05-22 11:01:04 +0900
commit267e528253801423768a1197b0c7d76e073ee9ab (patch)
tree011a67e90a189ebdc5e97045a0322111ad896a95 /java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java
parente077c014616f7b4e28dbbfab622ba36c8e922268 (diff)
downloadlatinime-267e528253801423768a1197b0c7d76e073ee9ab.tar.gz
latinime-267e528253801423768a1197b0c7d76e073ee9ab.tar.xz
latinime-267e528253801423768a1197b0c7d76e073ee9ab.zip
Arrange to send the rawChecksum to LatinIME.
Bug: 13125743 Change-Id: I5d111336e6a0f5ab4e93ff333654a7a1f8f46480
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java
index 80def701d..c35995b24 100644
--- a/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java
+++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java
@@ -89,10 +89,13 @@ public final class DictionaryProvider extends ContentProvider {
private static final class WordListInfo {
public final String mId;
public final String mLocale;
+ public final String mRawChecksum;
public final int mMatchLevel;
- public WordListInfo(final String id, final String locale, final int matchLevel) {
+ public WordListInfo(final String id, final String locale, final String rawChecksum,
+ final int matchLevel) {
mId = id;
mLocale = locale;
+ mRawChecksum = rawChecksum;
mMatchLevel = matchLevel;
}
}
@@ -106,7 +109,8 @@ public final class DictionaryProvider extends ContentProvider {
private static final class ResourcePathCursor extends AbstractCursor {
// Column names for the cursor returned by this content provider.
- static private final String[] columnNames = { "id", "locale" };
+ static private final String[] columnNames = { MetadataDbHelper.WORDLISTID_COLUMN,
+ MetadataDbHelper.LOCALE_COLUMN, MetadataDbHelper.RAW_CHECKSUM_COLUMN };
// The list of word lists served by this provider that match the client request.
final WordListInfo[] mWordLists;
@@ -141,6 +145,7 @@ public final class DictionaryProvider extends ContentProvider {
switch (column) {
case 0: return mWordLists[mPos].mId;
case 1: return mWordLists[mPos].mLocale;
+ case 2: return mWordLists[mPos].mRawChecksum;
default : return null;
}
}
@@ -357,6 +362,8 @@ public final class DictionaryProvider extends ContentProvider {
final int localeIndex = results.getColumnIndex(MetadataDbHelper.LOCALE_COLUMN);
final int localFileNameIndex =
results.getColumnIndex(MetadataDbHelper.LOCAL_FILENAME_COLUMN);
+ final int rawChecksumIndex =
+ results.getColumnIndex(MetadataDbHelper.RAW_CHECKSUM_COLUMN);
final int statusIndex = results.getColumnIndex(MetadataDbHelper.STATUS_COLUMN);
if (results.moveToFirst()) {
do {
@@ -379,6 +386,7 @@ public final class DictionaryProvider extends ContentProvider {
}
final String wordListLocale = results.getString(localeIndex);
final String wordListLocalFilename = results.getString(localFileNameIndex);
+ final String wordListRawChecksum = results.getString(rawChecksumIndex);
final int wordListStatus = results.getInt(statusIndex);
// Test the requested locale against this wordlist locale. The requested locale
// has to either match exactly or be more specific than the dictionary - a
@@ -412,8 +420,8 @@ public final class DictionaryProvider extends ContentProvider {
final WordListInfo currentBestMatch = dicts.get(wordListCategory);
if (null == currentBestMatch
|| currentBestMatch.mMatchLevel < matchLevel) {
- dicts.put(wordListCategory,
- new WordListInfo(wordListId, wordListLocale, matchLevel));
+ dicts.put(wordListCategory, new WordListInfo(wordListId, wordListLocale,
+ wordListRawChecksum, matchLevel));
}
} while (results.moveToNext());
}