diff options
author | Gaurav Asati <gasati@codeaurora.org> | 2014-05-21 09:57:35 +0530 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2014-10-11 16:31:43 -0700 |
commit | 40d410d22fec3a00cb4c4c6b8ac3f585ac845b94 (patch) | |
tree | 3cf665ce0baa1dd924a7caff6e056c3c5e338c01 | |
parent | 869566a941148a72175be5f172fcf139b40e112a (diff) | |
download | android_packages_apps_Bluetooth-40d410d22fec3a00cb4c4c6b8ac3f585ac845b94.tar.gz android_packages_apps_Bluetooth-40d410d22fec3a00cb4c4c6b8ac3f585ac845b94.tar.bz2 android_packages_apps_Bluetooth-40d410d22fec3a00cb4c4c6b8ac3f585ac845b94.zip |
Bluetooth: Initiate SDP after remote disconnect.
Initiate SDP if remote has disconnected just after pairing
and initiated A2dp/HFP connection.
Change-Id: Ia4ab534be1b9813c7147e1b1b037aa8e721ee190
CRs-Fixed: 664310
CRs-Fixed: 667989
-rw-r--r-- | src/com/android/bluetooth/btservice/AdapterService.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 9d5befdbb..181998df4 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -27,6 +27,7 @@ import android.app.Service; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; +import android.bluetooth.BluetoothUuid; import android.bluetooth.IBluetooth; import android.bluetooth.IBluetoothCallback; import android.bluetooth.IBluetoothManager; @@ -90,6 +91,10 @@ public class AdapterService extends Service { public static final int PROFILE_CONN_CONNECTED = 1; public static final int PROFILE_CONN_REJECTED = 2; + static final ParcelUuid[] A2DP_SOURCE_SINK_UUIDS = { + BluetoothUuid.AudioSource, + BluetoothUuid.AudioSink + }; static final String BLUETOOTH_ADMIN_PERM = android.Manifest.permission.BLUETOOTH_ADMIN; static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH; @@ -1231,6 +1236,13 @@ public class AdapterService extends Service { } if ((mHandler.hasMessages(MESSAGE_CONNECT_OTHER_PROFILES) == false) && (isQuietModeEnabled()== false)){ + ParcelUuid[] featureUuids = device.getUuids(); + // Some Carkits disconnect just after pairing,Initiate SDP for missing UUID's support + if ((!(BluetoothUuid.containsAnyUuid(featureUuids, A2DP_SOURCE_SINK_UUIDS))) || + (!(BluetoothUuid.isUuidPresent(featureUuids, BluetoothUuid.Handsfree)))) { + Log.v(TAG,"Initiate SDP for Missing UUID's support in remote"); + device.fetchUuidsWithSdp(); + } Message m = mHandler.obtainMessage(MESSAGE_CONNECT_OTHER_PROFILES); m.obj = device; m.arg1 = (int)firstProfileStatus; |