Merge branch 'android_branch' into android_gcm

This commit is contained in:
Eric House 2012-10-25 08:12:02 -07:00
commit d7d666e4f9
4 changed files with 18 additions and 4 deletions

View file

@ -293,7 +293,9 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getInfo
jDictBytes, jpath, NULL, check );
if ( NULL != dict ) {
if ( NULL != jinfo ) {
setInt( env, jinfo, "langCode", dict_getLangCode( dict ) );
XP_LangCode code = dict_getLangCode( dict );
XP_ASSERT( 0 < code );
setInt( env, jinfo, "langCode", code );
setInt( env, jinfo, "wordCount", dict_getWordCount( dict ) );
setString( env, jinfo, "md5Sum", dict_getMd5Sum( dict ) );
}

View file

@ -381,6 +381,14 @@ public class DictLangCache {
private static DictInfo getInfo( Context context, DictAndLoc dal )
{
DictInfo info = DBUtils.dictsGetInfo( context, dal.name );
// Tmp test that recovers from problem with new background download code
if ( null != info && 0 == info.langCode ) {
DbgUtils.logf( "getInfo: dropping info for %s b/c lang code wrong",
dal.name );
info = null;
}
if ( null == info ) {
String[] names = { dal.name };
DictUtils.DictPairs pairs = DictUtils.openDicts( context, names );

View file

@ -584,11 +584,11 @@ public class GameUtils {
String[][] missingNames,
int[] missingLang )
{
String[] dictNames = dictNames( context, rowid, missingLang );
String[] gameDicts = dictNames( context, rowid, missingLang );
HashSet<String> missingSet;
DictUtils.DictAndLoc[] installed = DictUtils.dictList( context );
missingSet = new HashSet<String>( Arrays.asList( dictNames ) );
missingSet = new HashSet<String>( Arrays.asList( gameDicts ) );
missingSet.remove( null );
boolean allHere = 0 != missingSet.size(); // need some non-null!
if ( allHere ) {
@ -596,6 +596,8 @@ public class GameUtils {
missingSet.remove( dal.name );
}
allHere = 0 == missingSet.size();
} else {
DbgUtils.logf( "gameDictsHere: game has no dicts!" );
}
if ( null != missingNames ) {
missingNames[0] =

View file

@ -143,7 +143,9 @@ public class CurGameInfo {
public void setLang( int lang, String dict )
{
if ( null != dict ) {
dictName = dict;
}
setLang( lang );
}