* The connection future and the connection itself aren't perfectly
* synchronized so we have to wait for both to acknowledge that the
* connection has been made
*/
final CountDownLatch connectedLatch = new CountDownLatch(1);
ConnectionStateListener connectedListener = new ConnectionStateListener() {
@Override
public void onConnectionConnected() {
connectedLatch.countDown();
}