selendroid/selendroid — pull request #175 by vladfridman (2013-11-18 17:38:14+00:00)
Title: Terminate adb connection only when flag is set. Also correctly add devices when they are already in the list.

1. Terminate adb connection only if -keepAdbAlive flag is off, which is the default. This solution gives us better control when to terminate the adb connection and when not to do it. Also it suppresses unnecessary exception messages about the fact that adb has already been initialed.

2. when device is connected in DefaultDeviceManager call listeners' onDeviceConnected method (not onDeviceDisconnected)

3. In DefaultDeviceManager when found already connected devices call onDeviceConnected().