From d23dd5978d60322613c0148556032cbce37e81b7 Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Thu, 25 Jun 2015 15:01:04 -0700 Subject: Don't prompt before downloading. We don't pay attention to the answer, so don't ask. Bug 22069694. Change-Id: Ic048d5570e68fbc9438c6577e27e6c7f68428606 --- .../inputmethod/dictionarypack/DictionaryProvider.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java') diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java index 659fe5c51..308b123e1 100644 --- a/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java +++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java @@ -243,14 +243,8 @@ public final class DictionaryProvider extends ContentProvider { // Fall through case DICTIONARY_V1_DICT_INFO: final String locale = uri.getLastPathSegment(); - // If LatinIME does not have a dictionary for this locale at all, it will - // send us true for this value. In this case, we may prompt the user for - // a decision about downloading a dictionary even over a metered connection. - final String mayPromptValue = - uri.getQueryParameter(QUERY_PARAMETER_MAY_PROMPT_USER); - final boolean mayPrompt = QUERY_PARAMETER_TRUE.equals(mayPromptValue); final Collection dictFiles = - getDictionaryWordListsForLocale(clientId, locale, mayPrompt); + getDictionaryWordListsForLocale(clientId, locale); // TODO: pass clientId to the following function DictionaryService.updateNowIfNotUpdatedInAVeryLongTime(getContext()); if (null != dictFiles && dictFiles.size() > 0) { @@ -343,11 +337,10 @@ public final class DictionaryProvider extends ContentProvider { * * @param clientId the ID of the client requesting the list * @param locale the locale for which we want the list, as a String - * @param mayPrompt true if we are allowed to prompt the user for arbitration via notification * @return a collection of ids. It is guaranteed to be non-null, but may be empty. */ private Collection getDictionaryWordListsForLocale(final String clientId, - final String locale, final boolean mayPrompt) { + final String locale) { final Context context = getContext(); final Cursor results = MetadataDbHelper.queryInstalledOrDeletingOrAvailableDictionaryMetadata(context, @@ -412,8 +405,7 @@ public final class DictionaryProvider extends ContentProvider { } } else if (MetadataDbHelper.STATUS_AVAILABLE == wordListStatus) { // The locale is the id for the main dictionary. - UpdateHandler.installIfNeverRequested(context, clientId, wordListId, - mayPrompt); + UpdateHandler.installIfNeverRequested(context, clientId, wordListId); continue; } final WordListInfo currentBestMatch = dicts.get(wordListCategory); -- cgit v1.2.3-83-g751a