From b5e484baa50b8ecc70cacdd8e0e58a56fe480a9a Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 16 Dec 2021 13:20:03 -0800 Subject: [PATCH] log rather than assert when game opened twice --- .../java/org/eehouse/android/xw4/BoardDelegate.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index 6ab8b5df1..561539881 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -492,7 +492,7 @@ public class BoardDelegate extends DelegateBase m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, -1 ); Log.i( TAG, "opening rowid %d", m_rowid ); m_overNotShown = true; - noteOpened( m_rowid ); + noteOpened( m_activity, m_rowid ); } // init private void getLock() @@ -3043,11 +3043,16 @@ public class BoardDelegate extends DelegateBase // This might need to map rowid->openCount so opens can stack static Set sOpenRows = new HashSet<>(); - private static void noteOpened( long rowid ) + private static void noteOpened( Context context, long rowid ) { Log.d( TAG, "noteOpened(%d)", rowid ); - Assert.assertTrueNR( !sOpenRows.contains(rowid) ); - sOpenRows.add( rowid ); + if ( BuildConfig.NON_RELEASE && sOpenRows.contains(rowid) ) { + String msg = String.format( "noteOpened(%d): already open", rowid ); + Utils.showToast( context, msg ); + DbgUtils.printStack( TAG ); + } else { + sOpenRows.add( rowid ); + } } private static void noteClosed( long rowid )