From 755b9e4c1f0220887e1fcc158f9d86900b7ed578 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 14 Sep 2020 12:03:58 -0700 Subject: [PATCH] re-register when variant changes useful only for testing releases --- .../src/main/java/org/eehouse/android/xw4/MQTTUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 71504d068..624fd0771 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 @@ -302,7 +302,8 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba } long now = Utils.getCurSeconds(); Log.d( TAG, "registerOnce(): now: %d; nextReg: %d", now, sNextReg ); - if ( now > sNextReg || ! BuildConfig.GIT_REV.equals(sLastRev) ) { + String revString = BuildConfig.GIT_REV + ':' + BuildConfig.VARIANT_NAME; + if ( now > sNextReg || ! revString.equals(sLastRev) ) { try { JSONObject params = new JSONObject(); params.put( "devid", mDevID ); @@ -334,8 +335,8 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba if ( 0 < atNext ) { DBUtils.setLongFor( mContext, KEY_NEXT_REG, atNext ); sNextReg = atNext; - DBUtils.setStringFor( mContext, KEY_LAST_WRITE, BuildConfig.GIT_REV ); - sLastRev = BuildConfig.GIT_REV; + DBUtils.setStringFor( mContext, KEY_LAST_WRITE, revString ); + sLastRev = revString; } String dupID = response.optString( "dupID", "" );