From 5d8674385723cda2a1ec5d1c359f4ef6926c5bdc Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 15 Nov 2020 16:30:13 -0800 Subject: [PATCH] enable mqtt game-gone message for DEBUG builds It should be enabled for all once the dup-devid problem should be behind everybody. --- xwords4/android/app/build.gradle | 3 +++ .../src/main/java/org/eehouse/android/xw4/MQTTUtils.java | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index f16f912dd..a62530247 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -88,6 +88,7 @@ android { buildConfigField "boolean", "OFFER_MQTT", "true" buildConfigField "boolean", "NON_RELEASE", "DEBUG || !IS_TAGGED_BUILD" buildConfigField "boolean", "HAVE_KNOWN_PLAYERS", "false" + buildConfigField "boolean", "DO_MQTT_GAME_GONE", "false" } xw4NoSMS { @@ -140,6 +141,7 @@ android { externalNativeBuild.ndkBuild.arguments += ['XW_BT_UUID=' + XWD_UUID] externalNativeBuild.ndkBuild.cFlags += ['-DXWFEATURE_KNOWNPLAYERS'] buildConfigField "boolean", "HAVE_KNOWN_PLAYERS", "true" + buildConfigField "boolean", "DO_MQTT_GAME_GONE", "true" } xw4dNoSMS { @@ -160,6 +162,7 @@ android { externalNativeBuild.ndkBuild.arguments += ['XW_BT_UUID=' + XWD_UUID] externalNativeBuild.ndkBuild.cFlags += ['-DXWFEATURE_KNOWNPLAYERS'] buildConfigField "boolean", "HAVE_KNOWN_PLAYERS", "true" + buildConfigField "boolean", "DO_MQTT_GAME_GONE", "true" } xw4SMS { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java index d25cd9064..629597220 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java @@ -598,9 +598,12 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba public static void handleGameGone( Context context, CommsAddrRec from, int gameID ) { - // new MQTTServiceHelper( context, from ) - // .postEvent( MultiService.MultiEvent.MESSAGE_NOGAME, gameID ); - Log.d( TAG, "not posting game-gone for now (gameID: %d)" , gameID ); + if ( BuildConfig.DO_MQTT_GAME_GONE ) { + new MQTTServiceHelper( context, from ) + .postEvent( MultiService.MultiEvent.MESSAGE_NOGAME, gameID ); + } else { + Log.d( TAG, "not posting game-gone for now (gameID: %d)" , gameID ); + } } public static void fcmConfirmed( Context context, boolean working )