Use extended SDP discovery in btchat example.

Android's minimal service discovery is very limited and more often than
not fails entirely. Using FulklDiscovery dramatically increases the
chance to find the remote SPP chat server.

Task-number: QTBUG-38140
Change-Id: I1df55f74a6896312236ef06485c4063c9e893e6c
Reviewed-by: Nedim Hadzic <nhadzic@blackberry.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Build snippets during developer builds with examples only.

This replaces an earlier Android specific solution against
a more generic solution.

Task-number: QTBUG-37638
Change-Id: I472ea48567e872c658094a5576b9260bf2d02c89
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Fix inconsistent behavior between BtDiscoveryModel & BtServiceDiscoveryAgent

The model always resets the model content when starting a new service
discovery. However QBluetoothServiceDiscovery doesn't do that. It adds
newly discovered services and maintains the existing services. Since
the model updates its content based on the serviceDiscovered signal,
every second run created an empty list or only ever added services.

Change-Id: I9c1d29562b9178678ab42bee98d5d1e3d0c4367f
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Don't double up the internal list of discovered services

Convention is that calling QBluetoothServiceDiscoveryAgent
maintains an internal list of discovered services. When start() is called
already discovered services are kept unless clear() was called. The Bluez
code never checked which services were already discovered by previous
discovery runs. This patch fixes this problem.

Change-Id: I3987d6ea65ea41aefc9726acc31f6abaa478c72c
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Refactor disconnection signals emittance in QBluetoothSocket

This fixes duplicate switching to the unconnected state in case
the disconnect() signal is used to reconnect.

[ChangeLog][QtBluetooth][QBluetoothSocket] Fixed duplicate emission
of unconnected state in the reconnection case.

Change-Id: If449420d936c96e62518fc408e6a1e35b79988a8
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Fix internal buffer corruption in QBluetoothSocket (BlueZ)

When _q_readNotify() is called and no data is available (e.g. in case
of timeout), then the internal buffer grows indefinitely, causing a
one time corruption of the following good data.

Change-Id: I75929382db73953bbccdd86b9ae248329df879fa
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Fix a crash in QBluetoothSocket on reconnection attempt (BlueZ)

Ensure a native socket is obtained after QBluetoothSocket has been closed.

[ChangeLog][QtBluetooth][QBluetoothSocket] Fixed a crash on reconnect.

Change-Id: I9f470d23366250dc20ad3305ddec16300c1ad8ec
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>