Cleanup connection destruction to avoid ConcurrentModificationException.

disconnectConferenceParticipantshandleConnectionDestruction attempts to
modify the hashmap while looping through it; calling
handleConnectionDestruction is the source of this and can cause a
ConcurrentModificationException.

handleConnectionDestruction just removes the participant from
mConferenceParticipantConnections and destroys it; we're already destroying
it in disconnectConferenceParticipants and we call clear, so we're removing
it.  The only thing left to do is to update the manage conference
property, which we can optimally just do once after we cleared the
connections anyways.  This avoids modifying the HashMap while we are
looping through it.

Test: Run unit tests.
Bug: 145654233
Change-Id: I47bc0d5c93dbf6b5f61c013a9884447d3a9af19c
1 file changed