Kaydet (Commit) 657e4fbf authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Fix removal of stale servers in selector.

Change-Id: I95a378cade77a7e53ef6baa69a6e9223d13e1526
üst cb6d2ed2
......@@ -220,8 +220,6 @@ public class SelectorActivity extends SherlockActivity {
// Bluetooth -- Remove old
for (Entry<Server, View> aEntry : mBluetoothServers.entrySet()) {
if (!Arrays.asList(aServers).contains(aEntry.getKey())) {
System.out.println("Removing view "
+ aEntry.getKey().getName());
mBluetoothServers.remove(aEntry.getKey());
mBluetoothList.removeView((View) aEntry.getValue()
.getParent());
......@@ -230,8 +228,7 @@ public class SelectorActivity extends SherlockActivity {
// Network -- Remove old
for (Entry<Server, View> aEntry : mNetworkServers.entrySet()) {
if (!Arrays.asList(aServers).contains(aEntry.getKey())) {
System.out.println("Removing view");
mNetworkServers.remove(aEntry.getKey().getName());
mNetworkServers.remove(aEntry.getKey());
mNetworkList.removeView((View) aEntry.getValue()
.getParent());
}
......@@ -262,8 +259,8 @@ public class SelectorActivity extends SherlockActivity {
}
}
// Hide as necessary
// Hide as necessary
mBluetoothContainer
.setVisibility((mBluetoothServers.size() != 0) ? View.VISIBLE
: View.GONE);
......
......@@ -24,7 +24,7 @@ public class ServerFinder {
private static final String CHARSET = "UTF-8";
private static final long SEARCH_INTERVAL = 1000 * 20;
private static final long SEARCH_INTERVAL = 1000 * 15;
private DatagramSocket mSocket = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment