set quarantine count to 1 for debug builds

This commit is contained in:
Eric House 2022-10-12 08:08:52 -07:00
parent be9d80533e
commit 34a72705c0
2 changed files with 4 additions and 3 deletions

View file

@ -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 {

View file

@ -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();