From 218d232798b8b86410d911ac9231ff866dbf662b Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 12 Feb 2014 07:35:49 -0800 Subject: [PATCH] add dictNames() variant that takes a GameLock --- .../org/eehouse/android/xw4/GameUtils.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 0c2d4a13f..d650507c4 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -596,6 +596,23 @@ public class GameUtils { int[] missingLang ) { byte[] stream = savedGame( context, rowid ); + return dictNames( context, stream, missingLang ); + } + + public static String[] dictNames( Context context, long rowid ) + { + return dictNames( context, rowid, null ); + } + + public static String[] dictNames( Context context, GameLock lock ) + { + byte[] stream = savedGame( context, lock ); + return dictNames( context, stream, null ); + } + + private static String[] dictNames( Context context, byte[] stream, + int[] missingLang ) + { CurGameInfo gi = new CurGameInfo( context ); XwJNI.gi_from_stream( gi, stream ); if ( null != missingLang ) { @@ -604,11 +621,6 @@ public class GameUtils { return gi.dictNames(); } - public static String[] dictNames( Context context, long rowid ) - { - return dictNames( context, rowid, null ); - } - public static boolean gameDictsHere( Context context, long rowid ) { return gameDictsHere( context, rowid, null, null );