when normal means don't succeed in generating summary, try again with

via JNIThread's cache.
This commit is contained in:
Eric House 2016-04-04 11:35:39 -07:00
parent f47a11aa42
commit b6431f0373

View file

@ -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 );