diff options
author | Anubhav Gupta <anubhavg@codeaurora.org> | 2013-09-17 11:20:27 +0530 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-06-05 00:44:09 +0000 |
commit | e316dfc9b3f648ad3d7b2691927758ea885043c0 (patch) | |
tree | f627d80a65bdeb59aced598278624e5af2b5447d /src/com/android/bluetooth/a2dp/A2dpService.java | |
parent | 6ddb5d5b31b3e4e21b57bbe0457692fdbcc97eba (diff) | |
download | android_packages_apps_Bluetooth-e316dfc9b3f648ad3d7b2691927758ea885043c0.tar.gz android_packages_apps_Bluetooth-e316dfc9b3f648ad3d7b2691927758ea885043c0.tar.bz2 android_packages_apps_Bluetooth-e316dfc9b3f648ad3d7b2691927758ea885043c0.zip |
Check for A2dp SNK UUID supported by remote
Check for A2dp sNK UUID supported by remote before proceeding
with A2dp SNK connection when DUT acts as A2dp SRC.
This change addresses the issue where Host being A2dp SRC is
seen trying connecting to other A2dp SRC repeatedly.
This will ensure that DUT being A2dp SRC does not try to connect
to A2dp SRC only peers.
Change-Id: I0200582a69b3d4e9b7f92516ba92f34054a1f4dc
(cherry picked from commit 5b7325d795331a249a70fdfd20a9f29bed388f1d)
(cherry picked from commit 27f0077dde25b69442aff316e5c60d32f2275a65)
(cherry picked from commit c5b6b44414be53bbb75e064412a7d2d49ffe871f)
Diffstat (limited to 'src/com/android/bluetooth/a2dp/A2dpService.java')
-rwxr-xr-x | src/com/android/bluetooth/a2dp/A2dpService.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java index bae637398..e14302caf 100755 --- a/src/com/android/bluetooth/a2dp/A2dpService.java +++ b/src/com/android/bluetooth/a2dp/A2dpService.java @@ -18,9 +18,11 @@ package com.android.bluetooth.a2dp; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; +import android.bluetooth.BluetoothUuid; import android.bluetooth.IBluetoothA2dp; import android.content.Context; import android.content.Intent; +import android.os.ParcelUuid; import android.provider.Settings; import android.util.Log; import com.android.bluetooth.avrcp.Avrcp; @@ -42,6 +44,13 @@ public class A2dpService extends ProfileService { private A2dpStateMachine mStateMachine; private Avrcp mAvrcp; private static A2dpService sAd2dpService; + static final ParcelUuid[] A2DP_SOURCE_UUID = { + BluetoothUuid.AudioSource + }; + static final ParcelUuid[] A2DP_SOURCE_SINK_UUIDS = { + BluetoothUuid.AudioSource, + BluetoothUuid.AudioSink + }; protected String getName() { return TAG; @@ -123,6 +132,12 @@ public class A2dpService extends ProfileService { if (getPriority(device) == BluetoothProfile.PRIORITY_OFF) { return false; } + ParcelUuid[] featureUuids = device.getUuids(); + if ((BluetoothUuid.containsAnyUuid(featureUuids, A2DP_SOURCE_UUID)) && + !(BluetoothUuid.containsAllUuids(featureUuids ,A2DP_SOURCE_SINK_UUIDS))) { + Log.e(TAG,"Remote does not have A2dp Sink UUID"); + return false; + } int connectionState = mStateMachine.getConnectionState(device); if (connectionState == BluetoothProfile.STATE_CONNECTED || |