Switch from HashSet to set backed by a ConcurrentHashMap to prevent
ConcurrentModificationExceptions.
Bug:
16901565
Change-Id: I7666ef61e94994963b2c2634a9a250365e753888
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
/**
* RemoteConnection object used by RemoteConnectionService.
private IConnectionService mConnectionService;
private final String mConnectionId;
- private final Set<Listener> mListeners = new HashSet<>();
+ private final Set<Listener> mListeners = Collections.newSetFromMap(
+ new ConcurrentHashMap<Listener, Boolean>(2));
private final Set<RemoteConnection> mConferenceableConnections = new HashSet<>();
private int mState = Connection.State.NEW;