diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java index 94710aca3..1f0f8497c 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictLangCache.java @@ -34,6 +34,7 @@ import org.eehouse.android.xw4.jni.JNIUtilsImpl; import org.eehouse.android.xw4.jni.XwJNI; import org.eehouse.android.xw4.loc.LocUtils; +import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; @@ -299,6 +300,12 @@ public class DictLangCache { return result; } + public static long getFileLen( Context context, DictAndLoc dal ) + { + File path = dal.getPath( context ); + return path.length(); + } + public static int getDictLangCode( Context context, String dict ) { return getInfo( context, dict ).langCode; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictUtils.java index 5f6bc27bd..ed7130bf2 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictUtils.java @@ -117,6 +117,12 @@ public class DictUtils { public String name; public DictLoc loc; + public File getPath( Context context ) + { + File path = getDictFile( context, addDictExtn(name), loc ); + return path; + } + @Override public boolean equals( Object obj ) { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java index 9473b124e..8ade9a7eb 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/UpdateCheckReceiver.java @@ -62,6 +62,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver { private static final String k_LANG = "lang"; private static final String k_MD5SUM = "md5sum"; private static final String k_INDEX = "index"; + private static final String k_LEN = "len"; private static final String k_URL = "url"; private static final String k_DEVID = "did"; private static final String k_DEBUG = "dbg"; @@ -215,11 +216,13 @@ public class UpdateCheckReceiver extends BroadcastReceiver { int lang = DictLangCache.getDictLangCode( context, dal ); String langStr = DictLangCache.getLangName( context, lang ); String sum = DictLangCache.getDictMD5Sum( context, dal.name ); + long len = DictLangCache.getFileLen( context, dal ); try { params.put( k_NAME, dal.name ); params.put( k_LANG, langStr ); params.put( k_MD5SUM, sum ); params.put( k_INDEX, index ); + params.put( k_LEN, len ); } catch( org.json.JSONException jse ) { Log.ex( TAG, jse ); }