Loading java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java +12 −4 Original line number Diff line number Diff line Loading @@ -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; } } Loading @@ -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; Loading Loading @@ -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; } } Loading Loading @@ -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 { Loading @@ -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 Loading Loading @@ -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()); } Loading java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java +2 −1 Original line number Diff line number Diff line Loading @@ -167,8 +167,9 @@ public final class BinaryDictionaryFileDumper { do { final String wordListId = cursor.getString(0); final String wordListLocale = cursor.getString(1); final String wordListRawChecksum = cursor.getString(2); if (TextUtils.isEmpty(wordListId)) continue; list.add(new WordListInfo(wordListId, wordListLocale)); list.add(new WordListInfo(wordListId, wordListLocale, wordListRawChecksum)); } while (cursor.moveToNext()); return list; } catch (RemoteException e) { Loading java/src/com/android/inputmethod/latin/WordListInfo.java +3 −1 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ package com.android.inputmethod.latin; public final class WordListInfo { public final String mId; public final String mLocale; public WordListInfo(final String id, final String locale) { public final String mRawChecksum; public WordListInfo(final String id, final String locale, final String rawChecksum) { mId = id; mLocale = locale; mRawChecksum = rawChecksum; } } Loading
java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java +12 −4 Original line number Diff line number Diff line Loading @@ -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; } } Loading @@ -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; Loading Loading @@ -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; } } Loading Loading @@ -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 { Loading @@ -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 Loading Loading @@ -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()); } Loading
java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java +2 −1 Original line number Diff line number Diff line Loading @@ -167,8 +167,9 @@ public final class BinaryDictionaryFileDumper { do { final String wordListId = cursor.getString(0); final String wordListLocale = cursor.getString(1); final String wordListRawChecksum = cursor.getString(2); if (TextUtils.isEmpty(wordListId)) continue; list.add(new WordListInfo(wordListId, wordListLocale)); list.add(new WordListInfo(wordListId, wordListLocale, wordListRawChecksum)); } while (cursor.moveToNext()); return list; } catch (RemoteException e) { Loading
java/src/com/android/inputmethod/latin/WordListInfo.java +3 −1 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ package com.android.inputmethod.latin; public final class WordListInfo { public final String mId; public final String mLocale; public WordListInfo(final String id, final String locale) { public final String mRawChecksum; public WordListInfo(final String id, final String locale, final String rawChecksum) { mId = id; mLocale = locale; mRawChecksum = rawChecksum; } }