diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java index 26b7bb712..85af2537f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/NetLaunchInfo.java @@ -185,6 +185,8 @@ public class NetLaunchInfo { } } + removeUnsupported( supported ); + dict = data.getQueryParameter( WORDLIST_KEY ); String langStr = data.getQueryParameter( LANG_KEY ); lang = Integer.decode( langStr ); @@ -369,6 +371,7 @@ public class NetLaunchInfo { private void init( Context context, String data ) { + CommsConnTypeSet supported = CommsConnTypeSet.getSupported( context ); try { JSONObject json = new JSONObject( data ); @@ -386,7 +389,6 @@ public class NetLaunchInfo { m_gameID = json.optInt( MultiService.GAMEID, 0 ); // Try each type - CommsConnTypeSet supported = CommsConnTypeSet.getSupported( context ); for ( CommsConnType typ : supported.getTypes() ) { if ( hasAddrs && !m_addrs.contains( typ ) ) { continue; @@ -422,6 +424,8 @@ public class NetLaunchInfo { DbgUtils.loge( jse ); } + removeUnsupported( supported ); + calcValid(); } @@ -529,6 +533,16 @@ public class NetLaunchInfo { && 0 != gameID(); } + private void removeUnsupported( CommsConnTypeSet supported ) + { + for ( Iterator iter = m_addrs.iterator(); + iter.hasNext(); ) { + if ( !supported.contains( iter.next() ) ) { + iter.remove(); + } + } + } + private void calcValid() { boolean valid = hasCommon() && null != m_addrs;