cleanup (no behavior change)

This commit is contained in:
Eric House 2018-12-11 06:57:18 -08:00
parent bfad324bb4
commit f2322d7e81

View file

@ -182,20 +182,20 @@ public class SMSService extends XWService {
public static void handleFrom( Context context, byte[] buffer, public static void handleFrom( Context context, byte[] buffer,
String phone ) String phone )
{ {
Intent intent = getIntentTo( context, SMSAction.HANDLEDATA ); Intent intent = getIntentTo( context, SMSAction.HANDLEDATA )
intent.putExtra( BUFFER, buffer ); .putExtra( BUFFER, buffer )
intent.putExtra( PHONE, phone ); .putExtra( PHONE, phone );
startService( context, intent ); startService( context, intent );
} }
public static void inviteRemote( Context context, String phone, public static void inviteRemote( Context context, String phone,
NetLaunchInfo nli ) NetLaunchInfo nli )
{ {
Intent intent = getIntentTo( context, SMSAction.INVITE );
intent.putExtra( PHONE, phone );
Log.w( TAG, "inviteRemote(%s, '%s')", phone, nli ); Log.w( TAG, "inviteRemote(%s, '%s')", phone, nli );
byte[] data = nli.asByteArray(); byte[] data = nli.asByteArray();
intent.putExtra( GAMEDATA_BA, data ); Intent intent = getIntentTo( context, SMSAction.INVITE )
.putExtra( PHONE, phone )
.putExtra( GAMEDATA_BA, data );
startService( context, intent ); startService( context, intent );
} }
@ -204,10 +204,10 @@ public class SMSService extends XWService {
{ {
int nSent = -1; int nSent = -1;
if ( XWPrefs.getSMSEnabled( context ) ) { if ( XWPrefs.getSMSEnabled( context ) ) {
Intent intent = getIntentTo( context, SMSAction.SEND ); Intent intent = getIntentTo( context, SMSAction.SEND )
intent.putExtra( PHONE, phone ); .putExtra( PHONE, phone )
intent.putExtra( MultiService.GAMEID, gameID ); .putExtra( MultiService.GAMEID, gameID )
intent.putExtra( BINBUFFER, binmsg ); .putExtra( BINBUFFER, binmsg );
startService( context, intent ); startService( context, intent );
nSent = binmsg.length; nSent = binmsg.length;
} else { } else {
@ -218,9 +218,9 @@ public class SMSService extends XWService {
public static void gameDied( Context context, int gameID, String phone ) public static void gameDied( Context context, int gameID, String phone )
{ {
Intent intent = getIntentTo( context, SMSAction.REMOVE ); Intent intent = getIntentTo( context, SMSAction.REMOVE )
intent.putExtra( PHONE, phone ); .putExtra( PHONE, phone )
intent.putExtra( MultiService.GAMEID, gameID ); .putExtra( MultiService.GAMEID, gameID );
startService( context, intent ); startService( context, intent );
} }
@ -264,8 +264,8 @@ public class SMSService extends XWService {
private static Intent getIntentTo( Context context, SMSAction cmd ) private static Intent getIntentTo( Context context, SMSAction cmd )
{ {
Intent intent = new Intent( context, SMSService.class ); Intent intent = new Intent( context, SMSService.class )
intent.putExtra( CMD_STR, cmd.ordinal() ); .putExtra( CMD_STR, cmd.ordinal() );
return intent; return intent;
} }