diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index 913344e92..53497baaf 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -1992,7 +1992,7 @@ public class GamesListDelegate extends ListDelegateBase // DEBUG only case R.id.games_game_markbad: - Quarantine.recordOpened( selRowIDs[0] ); + Quarantine.markBad( selRowIDs[0] ); break; default: diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Quarantine.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Quarantine.java index 43726258f..dc52ea53b 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Quarantine.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Quarantine.java @@ -30,6 +30,7 @@ import java.io.Serializable; public class Quarantine { private static final String TAG = Quarantine.class.getSimpleName(); private static final String DATA_KEY = TAG + "/key"; + private static final int BAD_COUNT = 2; public static boolean safeToOpen( long rowid ) { @@ -37,7 +38,7 @@ public class Quarantine { synchronized ( sDataRef ) { count = get().getFor( rowid ); } - boolean result = count == 0; // Not too strict? + boolean result = count < BAD_COUNT; if ( !result ) { Log.d( TAG, "safeToOpen(%d) => %b (count=%d)", rowid, result, count ); } @@ -70,6 +71,17 @@ public class Quarantine { } } + public static void markBad( long rowid ) + { + synchronized ( sDataRef ) { + for ( int ii = 0; ii < BAD_COUNT; ++ii ) { + get().increment( rowid ); + } + store(); + Log.d( TAG, "markBad(%d): %s", rowid, sDataRef[0].toString() ); + } + } + private static class Data implements Serializable { private HashMap mCounts = new HashMap<>();