mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
pass context and use to post lock-failure toast
This commit is contained in:
parent
f5c9962b66
commit
e62e51f9cd
5 changed files with 9 additions and 6 deletions
|
@ -1373,7 +1373,7 @@ public class BTService extends XWService {
|
|||
String btAddr )
|
||||
{
|
||||
BTCmd result;
|
||||
if ( mHelper.handleInvitation( nli, btName,
|
||||
if ( mHelper.handleInvitation( this, nli, btName,
|
||||
DictFetchOwner.OWNER_BT ) ) {
|
||||
result = BTCmd.INVITE_ACCPT;
|
||||
} else {
|
||||
|
|
|
@ -303,7 +303,8 @@ public class RelayService extends JobIntentService
|
|||
{
|
||||
Log.d( TAG, "receiveInvitation: got nli from %d: %s", srcDevID,
|
||||
nli.toString() );
|
||||
if ( !mHelper.handleInvitation( nli, null, DictFetchOwner.OWNER_RELAY ) ) {
|
||||
if ( !mHelper.handleInvitation( this, nli, null,
|
||||
DictFetchOwner.OWNER_RELAY ) ) {
|
||||
Log.d( TAG, "handleInvitation() failed" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -495,7 +495,7 @@ public class SMSService extends XWService {
|
|||
private void makeForInvite( String phone, NetLaunchInfo nli )
|
||||
{
|
||||
if ( nli != null ) {
|
||||
mHelper.handleInvitation( nli, phone, DictFetchOwner.OWNER_SMS );
|
||||
mHelper.handleInvitation( this, nli, phone, DictFetchOwner.OWNER_SMS );
|
||||
ackInvite( phone, nli.gameID() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -767,7 +767,7 @@ public class WiDirService extends XWService {
|
|||
NetLaunchInfo nli = NetLaunchInfo.makeFrom( this, nliData );
|
||||
String returnMac = intent.getStringExtra( KEY_SRC );
|
||||
|
||||
if ( !mHelper.handleInvitation( nli, returnMac, DictFetchOwner.OWNER_P2P ) ) {
|
||||
if ( !mHelper.handleInvitation( this, nli, returnMac, DictFetchOwner.OWNER_P2P ) ) {
|
||||
Log.d( TAG, "handleInvitation() failed" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,8 +117,8 @@ abstract class XWServiceHelper {
|
|||
}
|
||||
}
|
||||
|
||||
protected boolean handleInvitation( NetLaunchInfo nli, String device,
|
||||
DictFetchOwner dfo )
|
||||
protected boolean handleInvitation( Context context, NetLaunchInfo nli,
|
||||
String device, DictFetchOwner dfo )
|
||||
{
|
||||
boolean success = nli.isValid() && checkNotInFlight( nli );
|
||||
if ( success ) {
|
||||
|
@ -141,6 +141,8 @@ abstract class XWServiceHelper {
|
|||
GamePtr gamePtr = GameUtils
|
||||
.loadMakeGame( mService, gi, lock );
|
||||
gamePtr.release();
|
||||
} else {
|
||||
DbgUtils.toastNoLock( TAG, context, "handleInvitation()" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue