don't send packets if SMS play disabled

This commit is contained in:
Eric House 2012-07-26 07:21:16 -07:00
parent 1abba7e560
commit e70fbda502

View file

@ -132,12 +132,18 @@ public class SMSService extends Service {
public static int sendPacket( Context context, String phone, public static int sendPacket( Context context, String phone,
int gameID, byte[] binmsg ) int gameID, byte[] binmsg )
{ {
Intent intent = getIntentTo( context, SEND ); int nSent = -1;
intent.putExtra( PHONE, phone ); if ( XWPrefs.getSMSEnabled( context ) ) {
intent.putExtra( GAMEID, gameID ); Intent intent = getIntentTo( context, SEND );
intent.putExtra( BINBUFFER, binmsg ); intent.putExtra( PHONE, phone );
context.startService( intent ); intent.putExtra( GAMEID, gameID );
return binmsg.length; 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 ) public static void gameDied( Context context, int gameID, String phone )