mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
don't send packets if SMS play disabled
This commit is contained in:
parent
1abba7e560
commit
e70fbda502
1 changed files with 12 additions and 6 deletions
|
@ -132,12 +132,18 @@ public class SMSService extends Service {
|
|||
public static int sendPacket( Context context, String phone,
|
||||
int gameID, byte[] binmsg )
|
||||
{
|
||||
Intent intent = getIntentTo( context, SEND );
|
||||
intent.putExtra( PHONE, phone );
|
||||
intent.putExtra( GAMEID, gameID );
|
||||
intent.putExtra( BINBUFFER, binmsg );
|
||||
context.startService( intent );
|
||||
return binmsg.length;
|
||||
int nSent = -1;
|
||||
if ( XWPrefs.getSMSEnabled( context ) ) {
|
||||
Intent intent = getIntentTo( context, SEND );
|
||||
intent.putExtra( PHONE, phone );
|
||||
intent.putExtra( GAMEID, gameID );
|
||||
intent.putExtra( BINBUFFER, binmsg );
|
||||
context.startService( intent );
|
||||
nSent = binmsg.length;
|
||||
} else {
|
||||
DbgUtils.logf( "sendPacket: dropping because SMS disabled" );
|
||||
}
|
||||
return nSent;
|
||||
}
|
||||
|
||||
public static void gameDied( Context context, int gameID, String phone )
|
||||
|
|
Loading…
Add table
Reference in a new issue