From d286e7011fe263df32fe2eadfde5487a1fd1d0b2 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 18 Jul 2011 19:01:02 -0700 Subject: [PATCH] FOR DEBUGGING ONLY: test theory about dropped dialogs. --- .../src/org/eehouse/android/xw4/BoardActivity.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index 547c15579..139a7daa9 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -102,6 +102,7 @@ public class BoardActivity extends XWActivity private Thread m_blockingThread; private JNIThread m_jniThread; private JNIThread.GameStateInfo m_gsi; + private boolean m_blockingDlgPosted = false; private ProgressDialog m_progress; private boolean m_isVisible; @@ -1048,6 +1049,9 @@ public class BoardActivity extends XWActivity private void loadGame() { + Assert.assertFalse( m_blockingDlgPosted ); // found the problem! + m_blockingDlgPosted = false; + if ( 0 == m_jniGamePtr ) { Assert.assertNull( m_gameLock ); m_gameLock = new GameUtils.GameLock( m_name, true ).lock(); @@ -1223,12 +1227,6 @@ public class BoardActivity extends XWActivity }; } - /* m_blockingDlgPosted: very rarely m_forResultWait will get - * interrupted before the runnable gets run. In that case there's - * no dialog to dismiss. So track it. - */ - private boolean m_blockingDlgPosted = false; - private int waitBlockingDialog( final int dlgID, int cancelResult ) { int result = cancelResult; @@ -1310,6 +1308,7 @@ public class BoardActivity extends XWActivity if ( null != m_jniThread ) { if ( save ) { + Utils.logf( "posting CMD_SAVE" ); m_jniThread.handle( JNIThread.JNICmd.CMD_SAVE ); } m_jniThread.waitToStop();