when blocking dialogs want to stack, rather than assert, just drop the

second one.  I'm not sure this is the right thing to do, but it won't
matter except when the assert was firing.
This commit is contained in:
Andy2 2011-07-13 06:13:38 -07:00
parent 1686f3d9a8
commit ea205ebf97

View file

@ -1232,29 +1232,34 @@ public class BoardActivity extends XWActivity
private int waitBlockingDialog( final int dlgID, int cancelResult )
{
Assert.assertFalse( m_blockingDlgPosted );
setBlockingThread();
int result = cancelResult;
if ( m_blockingDlgPosted ) { // this has been true; dunno why
Utils.logf( "waitBlockingDialog: dropping dlgID %d", dlgID );
} else {
setBlockingThread();
m_handler.post( new Runnable() {
public void run() {
showDialog( dlgID ); // crash
m_blockingDlgPosted = true;
}
} );
m_handler.post( new Runnable() {
public void run() {
showDialog( dlgID ); // crash
m_blockingDlgPosted = true;
}
} );
try {
m_forResultWait.acquire();
m_blockingDlgPosted = false;
} catch ( java.lang.InterruptedException ie ) {
Utils.logf( "waitBlockingDialog: got " + ie.toString() );
m_resultCode = cancelResult;
if ( m_blockingDlgPosted ) {
dismissDialog( dlgID );
try {
m_forResultWait.acquire();
m_blockingDlgPosted = false;
} catch ( java.lang.InterruptedException ie ) {
Utils.logf( "waitBlockingDialog: got " + ie.toString() );
m_resultCode = cancelResult;
if ( m_blockingDlgPosted ) {
dismissDialog( dlgID );
m_blockingDlgPosted = false;
}
}
clearBlockingThread();
result = m_resultCode;
}
clearBlockingThread();
return m_resultCode;
return result;
}
private void nonBlockingDialog( final int dlgID, String txt )