aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2015-03-24 22:38:52 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-24 22:38:52 +0000
commit442e51907713fffbdd790a38e7470291ae3365fd (patch)
tree66a8e8b4dc286be8e23d378c5fd67333fcc8b9db /java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java
parent9393497cf5c30708d7fe7591ded5a72ee45071f6 (diff)
parent600cca16cbd34cda966fd47bc822a673aee3788a (diff)
downloadlatinime-442e51907713fffbdd790a38e7470291ae3365fd.tar.gz
latinime-442e51907713fffbdd790a38e7470291ae3365fd.tar.xz
latinime-442e51907713fffbdd790a38e7470291ae3365fd.zip
am 600cca16: Merge "Force download the dictionaries after the apk package is updated."
* commit '600cca16cbd34cda966fd47bc822a673aee3788a': Force download the dictionaries after the apk package is updated.
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java')
-rw-r--r--java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java b/java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java
index 3d0e29ed0..3cd822a3c 100644
--- a/java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java
+++ b/java/src/com/android/inputmethod/dictionarypack/CommonPreferences.java
@@ -22,6 +22,8 @@ import android.content.SharedPreferences;
public final class CommonPreferences {
private static final String COMMON_PREFERENCES_NAME = "LatinImeDictPrefs";
+ public static final String PREF_FORCE_DOWNLOAD_DICT = "pref_key_force_download_dict";
+
public static SharedPreferences getCommonPreferences(final Context context) {
return context.getSharedPreferences(COMMON_PREFERENCES_NAME, 0);
}
@@ -37,4 +39,14 @@ public final class CommonPreferences {
editor.putBoolean(id, false);
editor.apply();
}
+
+ public static boolean isForceDownloadDict(Context context) {
+ return getCommonPreferences(context).getBoolean(PREF_FORCE_DOWNLOAD_DICT, false);
+ }
+
+ public static void setForceDownloadDict(Context context, boolean forceDownload) {
+ SharedPreferences.Editor editor = getCommonPreferences(context).edit();
+ editor.putBoolean(PREF_FORCE_DOWNLOAD_DICT, forceDownload);
+ editor.apply();
+ }
}