wifi: notify when game deleted

This commit is contained in:
Eric House 2016-12-02 08:17:03 -08:00
parent 54ed327406
commit f9d352cb25
2 changed files with 11 additions and 0 deletions

View file

@ -1210,6 +1210,9 @@ public class GameUtils {
} }
} }
break; break;
case COMMS_CONN_P2P:
WiDirService.gameDied( context, summary.gameID );
break;
} }
} }
} }

View file

@ -319,6 +319,14 @@ public class WiDirService extends XWService {
} }
} }
public static void gameDied( Context context, int gameID )
{
Iterator<BiDiSockWrap> iter = sSocketWrapMap.values().iterator();
while ( iter.hasNext() ) {
sendNoGame( iter.next(), null, gameID );
}
}
private static boolean initListeners( final Context context ) private static boolean initListeners( final Context context )
{ {
boolean succeeded = false; boolean succeeded = false;