From 34a72705c0b5173079a4be16297ac09fa5916279 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 12 Oct 2022 08:08:52 -0700 Subject: [PATCH] set quarantine count to 1 for debug builds --- xwords4/android/app/build.gradle | 2 ++ .../src/main/java/org/eehouse/android/xw4/Quarantine.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index 23bcffda8..2a686c9ac 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -132,6 +132,7 @@ android { buildConfigField "boolean", "NO_NEW_RELAY", "true" buildConfigField "boolean", "LOCUTILS_ENABLED", "false" buildConfigField "String", "LAST_COMMIT_FILE", "\"$LAST_COMMIT_FILE\"" + buildConfigField "int", "BAD_COUNT", "2" } xw4GPlay { @@ -188,6 +189,7 @@ android { resValue "string", "nfc_aid", "$NFC_AID_XW4d" externalNativeBuild.ndkBuild.cFlags += ['-DVARIANT_xw4d'] externalNativeBuild.ndkBuild.arguments += ['XW_BT_UUID=' + XWD_UUID] + buildConfigField "int", "BAD_COUNT", "1" } xw4dGPlay { 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 d47571b20..1973bfa11 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 @@ -32,7 +32,6 @@ import java.util.Map; 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; private static QData[] sDataRef = {null}; public static int getCount( long rowid ) @@ -47,7 +46,7 @@ public class Quarantine { public synchronized static boolean safeToOpen( long rowid ) { int count = getCount( rowid ); - boolean result = count < BAD_COUNT; + boolean result = count < BuildConfig.BAD_COUNT; if ( !result ) { Log.d( TAG, "safeToOpen(%d) => %b (count=%d)", rowid, result, count ); if ( BuildConfig.NON_RELEASE ) { @@ -96,7 +95,7 @@ public class Quarantine { public static void markBad( long rowid ) { synchronized ( sDataRef ) { - for ( int ii = 0; ii < BAD_COUNT; ++ii ) { + for ( int ii = 0; ii < BuildConfig.BAD_COUNT; ++ii ) { get().increment( rowid ); } store();