aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
diff options
context:
space:
mode:
authorJatin Matani <jatinm@google.com>2015-07-11 01:08:28 -0700
committerJatin Matani <jatinm@google.com>2015-07-11 01:08:28 -0700
commit5abefbb8d6e2a4bfe824d9c2d8904600d41f9387 (patch)
tree1c344e3a6deefc5bf4fd3fcc7a504f7b1491c5f8 /java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
parent1791ce07522f938a349eedeb22223449abe6c380 (diff)
parent9cd60fe1bb67cec755c1cee6d541272e64129072 (diff)
downloadlatinime-5abefbb8d6e2a4bfe824d9c2d8904600d41f9387.tar.gz
latinime-5abefbb8d6e2a4bfe824d9c2d8904600d41f9387.tar.xz
latinime-5abefbb8d6e2a4bfe824d9c2d8904600d41f9387.zip
resolved conflicts for merge of 9cd60fe1 to mnc-dev-plus-aosp
Change-Id: I1aad861d711170ab3dab0019d8e4ff02f058c423
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/DictionaryService.java')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/DictionaryService.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
index bbdf2a380..fe988ac70 100644
--- a/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
+++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java
@@ -192,27 +192,22 @@ public final class DictionaryService extends Service {
}
static void dispatchBroadcast(final Context context, final Intent intent) {
- if (DATE_CHANGED_INTENT_ACTION.equals(intent.getAction())) {
- // Do not force download dictionaries on date change updates.
- CommonPreferences.setForceDownloadDict(context, false);
+ final String action = intent.getAction();
+ if (DATE_CHANGED_INTENT_ACTION.equals(action)) {
// This happens when the date of the device changes. This normally happens
// at midnight local time, but it may happen if the user changes the date
// by hand or something similar happens.
checkTimeAndMaybeSetupUpdateAlarm(context);
- } else if (DictionaryPackConstants.UPDATE_NOW_INTENT_ACTION.equals(intent.getAction())) {
+ } else if (DictionaryPackConstants.UPDATE_NOW_INTENT_ACTION.equals(action)) {
// Intent to trigger an update now.
- UpdateHandler.tryUpdate(context, CommonPreferences.isForceDownloadDict(context));
- } else if (DictionaryPackConstants.INIT_AND_UPDATE_NOW_INTENT_ACTION.equals(
- intent.getAction())) {
- // Enable force download of dictionaries irrespective of wifi or metered connection.
- CommonPreferences.setForceDownloadDict(context, true);
-
+ UpdateHandler.tryUpdate(context);
+ } else if (DictionaryPackConstants.INIT_AND_UPDATE_NOW_INTENT_ACTION.equals(action)) {
// Initialize the client Db.
final String mClientId = context.getString(R.string.dictionary_pack_client_id);
BinaryDictionaryFileDumper.initializeClientRecordHelper(context, mClientId);
// Updates the metadata and the download the dictionaries.
- UpdateHandler.tryUpdate(context, true);
+ UpdateHandler.tryUpdate(context);
} else {
UpdateHandler.downloadFinished(context, intent);
}
@@ -263,7 +258,7 @@ public final class DictionaryService extends Service {
*/
public static void updateNowIfNotUpdatedInAVeryLongTime(final Context context) {
if (!isLastUpdateAtLeastThisOld(context, VERY_LONG_TIME_MILLIS)) return;
- UpdateHandler.tryUpdate(context, CommonPreferences.isForceDownloadDict(context));
+ UpdateHandler.tryUpdate(context);
}
/**