From bf06d4b4c2895843a52e4498bf82fd3ed0bf0b55 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 30 Jul 2018 07:37:20 -0700 Subject: [PATCH] fix not sending ACK_INVITE Logic error meant it was never sent. Now always send on receipt of a well-formed invitation, even if e.g. the recipient's missing a wordlist and the game can't be started immediately. --- .../src/main/java/org/eehouse/android/xw4/SMSService.java | 6 +++--- .../src/main/java/org/eehouse/android/xw4/XWService.java | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSService.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSService.java index 43af25959..49d26e588 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSService.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSService.java @@ -485,7 +485,7 @@ public class SMSService extends XWService { } postEvent( MultiEvent.SMS_RECEIVE_OK ); } else { - Log.w( TAG, "receiveBuffer(): bogus or incomplete message from phone %s", + Log.d( TAG, "receiveBuffer(): bogus or incomplete message from %s", senderPhone ); } } @@ -501,8 +501,8 @@ public class SMSService extends XWService { private void makeForInvite( String phone, NetLaunchInfo nli ) { - if ( nli != null && - handleInvitation( nli, phone, DictFetchOwner.OWNER_SMS ) ) { + if ( nli != null ) { + handleInvitation( nli, phone, DictFetchOwner.OWNER_SMS ); ackInvite( phone, nli.gameID() ); } } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWService.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWService.java index 9e6e1dbac..62e680abf 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWService.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWService.java @@ -89,6 +89,7 @@ abstract class XWService extends Service { abstract void postNotification( String device, int gameID, long rowid ); + // Return true if able to start game only protected boolean handleInvitation( NetLaunchInfo nli, String device, DictFetchOwner dfo ) { @@ -110,6 +111,7 @@ abstract class XWService extends Service { } postNotification( device, nli.gameID(), rowid ); + success = true; } else { Intent intent = MultiService .makeMissingDictIntent( this, nli, dfo ); @@ -118,6 +120,7 @@ abstract class XWService extends Service { } } } + Log.d( TAG, "handleInvitation() => %b", success ); return success; }