Fix a bug where AOSP Latin IME would not fill dictionaries

There is no reason not to contact the dictionary provider
when we don't have internet permission or when the URL
is empty. It knows how to handle both these cases.

Bug: 9388602
Change-Id: I30c4540551ad2f5e527d3acd1842bbd749feca89
main
Jean Chalard 2013-06-28 12:48:41 +09:00
parent 4ded1af210
commit 555c4236db
2 changed files with 2 additions and 8 deletions

View File

@ -439,7 +439,6 @@ public final class BinaryDictionaryFileDumper {
final ContentProviderClient client, final String clientId) throws RemoteException {
final String metadataFileUri = MetadataFileUriGetter.getMetadataUri(context);
final String metadataAdditionalId = MetadataFileUriGetter.getMetadataAdditionalId(context);
if (TextUtils.isEmpty(metadataFileUri)) return;
// Tell the content provider to reset all information about this client id
final Uri metadataContentUri = getProviderUriBuilder(clientId)
.appendPath(QUERY_PATH_METADATA)

View File

@ -293,13 +293,8 @@ final public class BinaryDictionaryGetter {
final Context context) {
final boolean hasDefaultWordList = DictionaryFactory.isDictionaryAvailable(context, locale);
// We need internet access to do the following. Only do this if the package actually
// has the permission.
if (context.checkCallingOrSelfPermission(android.Manifest.permission.INTERNET)
== PackageManager.PERMISSION_GRANTED) {
BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context,
hasDefaultWordList);
}
BinaryDictionaryFileDumper.cacheWordListsFromContentProvider(locale, context,
hasDefaultWordList);
final File[] cachedWordLists = getCachedWordLists(locale.toString(), context);
final String mainDictId = DictionaryInfoUtils.getMainDictId(locale);
final DictPackSettings dictPackSettings = new DictPackSettings(context);