aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
diff options
context:
space:
mode:
authorDan Zivkovic <zivkovic@google.com>2015-06-25 15:01:04 -0700
committerDan Zivkovic <zivkovic@google.com>2015-06-25 15:01:04 -0700
commitd23dd5978d60322613c0148556032cbce37e81b7 (patch)
tree8e9c8b66f958f0ee48fe968760f950b24b829b2d /java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
parent5e4c0caac31edcb48e851b2aefe7851c69abaf36 (diff)
downloadlatinime-d23dd5978d60322613c0148556032cbce37e81b7.tar.gz
latinime-d23dd5978d60322613c0148556032cbce37e81b7.tar.xz
latinime-d23dd5978d60322613c0148556032cbce37e81b7.zip
Don't prompt before downloading.
We don't pay attention to the answer, so don't ask. Bug 22069694. Change-Id: Ic048d5570e68fbc9438c6577e27e6c7f68428606
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java29
1 files changed, 8 insertions, 21 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
index df3fd4060..a02203d31 100644
--- a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
+++ b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java
@@ -907,9 +907,9 @@ public final class UpdateHandler {
// list because it may only install the latest version we know about for this specific
// word list ID / client ID combination.
public static void installIfNeverRequested(final Context context, final String clientId,
- final String wordlistId, final boolean mayPrompt) {
+ final String wordlistId) {
Log.i(TAG, "installIfNeverRequested() : ClientId = " + clientId
- + " : WordListId = " + wordlistId + " : MayPrompt = " + mayPrompt);
+ + " : WordListId = " + wordlistId);
final String[] idArray = wordlistId.split(DictionaryProvider.ID_CATEGORY_SEPARATOR);
// If we have a new-format dictionary id (category:manual_id), then use the
// specified category. Otherwise, it is a main dictionary, so force the
@@ -942,17 +942,6 @@ public final class UpdateHandler {
return;
}
- if (mayPrompt
- && DOWNLOAD_OVER_METERED_SETTING_UNKNOWN
- == getDownloadOverMeteredSetting(context)) {
- final ConnectivityManager cm =
- (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
- if (ConnectivityManagerCompatUtils.isActiveNetworkMetered(cm)) {
- showDictionaryAvailableNotification(context, clientId, installCandidate);
- return;
- }
- }
-
// We decided against prompting the user for a decision. This may be because we were
// explicitly asked not to, or because we are currently on wi-fi anyway, or because we
// already know the answer to the question. We'll enqueue a request ; StartDownloadAction
@@ -969,14 +958,12 @@ public final class UpdateHandler {
final String localeString = installCandidate.getAsString(MetadataDbHelper.LOCALE_COLUMN);
// We are in a content provider: we can't do any UI at all. We have to defer the displaying
// itself to the service. Also, we only display this when the user does not have a
- // dictionary for this language already: we know that from the mayPrompt argument.
- if (mayPrompt) {
- final Intent intent = new Intent();
- intent.setClass(context, DictionaryService.class);
- intent.setAction(DictionaryService.SHOW_DOWNLOAD_TOAST_INTENT_ACTION);
- intent.putExtra(DictionaryService.LOCALE_INTENT_ARGUMENT, localeString);
- context.startService(intent);
- }
+ // dictionary for this language already.
+ final Intent intent = new Intent();
+ intent.setClass(context, DictionaryService.class);
+ intent.setAction(DictionaryService.SHOW_DOWNLOAD_TOAST_INTENT_ACTION);
+ intent.putExtra(DictionaryService.LOCALE_INTENT_ARGUMENT, localeString);
+ context.startService(intent);
Log.i(TAG, "installIfNeverRequested() : StartDownloadAction for " + metadata);
actions.execute(context, new LogProblemReporter(TAG));
}