aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-03-24 14:56:54 -0700
committerMohammadinamul Sheik <inamul@google.com>2015-03-24 14:56:54 -0700
commit3bc3bc7971f15438732933cfac0db6e766e6a3e9 (patch)
tree0bdd6a1041bcd982424626bc0ff6018de1c09dc8 /java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java
parente1b91d4138b4f5b7e83d09d506e0be4a6b78467b (diff)
downloadlatinime-3bc3bc7971f15438732933cfac0db6e766e6a3e9.tar.gz
latinime-3bc3bc7971f15438732933cfac0db6e766e6a3e9.tar.xz
latinime-3bc3bc7971f15438732933cfac0db6e766e6a3e9.zip
Force download the dictionaries after the apk package is updated.
- Also display the notification when the dictionaries are auto updated Bug: 19808828 Change-Id: If5c4efb73d8bb554d812afcf7deafec3ac40a462
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java')
-rw-r--r--java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java b/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java
index 5c3abd2db..2a69d3650 100644
--- a/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java
+++ b/java/src/com/android/inputmethod/latin/SystemBroadcastReceiver.java
@@ -27,6 +27,8 @@ import android.util.Log;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
+import com.android.inputmethod.dictionarypack.CommonPreferences;
+import com.android.inputmethod.dictionarypack.DictionaryPackConstants;
import com.android.inputmethod.keyboard.KeyboardLayoutSet;
import com.android.inputmethod.latin.setup.SetupActivity;
import com.android.inputmethod.latin.utils.UncachedInputMethodManagerUtils;
@@ -70,6 +72,7 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver {
final InputMethodSubtype[] additionalSubtypes = richImm.getAdditionalSubtypes();
richImm.setAdditionalInputMethodSubtypes(additionalSubtypes);
toggleAppIcon(context);
+ downloadLatestDictionaries(context);
} else if (Intent.ACTION_BOOT_COMPLETED.equals(intentAction)) {
Log.i(TAG, "Boot has been completed");
toggleAppIcon(context);
@@ -97,6 +100,12 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver {
}
}
+ private void downloadLatestDictionaries(Context context) {
+ final Intent updateIntent = new Intent(
+ DictionaryPackConstants.INIT_AND_UPDATE_NOW_INTENT_ACTION);
+ context.sendBroadcast(updateIntent);
+ }
+
private static void toggleAppIcon(final Context context) {
final int appInfoFlags = context.getApplicationInfo().flags;
final boolean isSystemApp = (appInfoFlags & ApplicationInfo.FLAG_SYSTEM) > 0;