From b6431f0373ae859be09c55da6e37c4dc5866b65a Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 4 Apr 2016 11:35:39 -0700 Subject: [PATCH] when normal means don't succeed in generating summary, try again with via JNIThread's cache. --- .../src/org/eehouse/android/xw4/GameListItem.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java index 2146dbad0..02cc57c32 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java @@ -43,9 +43,10 @@ import java.util.concurrent.LinkedBlockingQueue; import junit.framework.Assert; -import org.eehouse.android.xw4.jni.GameSummary; -import org.eehouse.android.xw4.loc.LocUtils; import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole; +import org.eehouse.android.xw4.jni.GameSummary; +import org.eehouse.android.xw4.jni.JNIThread; +import org.eehouse.android.xw4.loc.LocUtils; public class GameListItem extends LinearLayout implements View.OnClickListener, SelectableItem.LongClickHandler { @@ -358,6 +359,16 @@ public class GameListItem extends LinearLayout protected void onPostExecute( GameSummary summary ) { if ( 0 == --m_loadingCount ) { + if ( null == summary ) { + // Try again. Maybe it's open + JNIThread thread = JNIThread.getRetained( m_rowid ); + if ( null != thread ) { + summary = DBUtils.getSummary( m_context, + thread.getLock() ); + thread.release(); + } + } + m_summary = summary; boolean expanded = DBUtils.getExpanded( m_context, m_rowid );