summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-07-14 12:21:26 -0700
committerJaikumar Ganesh <jaikumar@google.com>2009-07-16 23:42:42 -0700
commit7f74d534f39c4d1e1db8604faa117dcf127cc8b9 (patch)
tree7973cb877de51edbc9519c36fc55ee21230df177 /core/java/android
parent15431a9482cedcfee7f5badc05c436e2c7cc7997 (diff)
downloadframeworks_base-7f74d534f39c4d1e1db8604faa117dcf127cc8b9.zip
frameworks_base-7f74d534f39c4d1e1db8604faa117dcf127cc8b9.tar.gz
frameworks_base-7f74d534f39c4d1e1db8604faa117dcf127cc8b9.tar.bz2
Reconnect to A2DP device only if it supports that profile, fix HF AG UUID.
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/bluetooth/BluetoothUuid.java2
-rw-r--r--core/java/android/server/BluetoothA2dpService.java15
-rw-r--r--core/java/android/server/BluetoothEventLoop.java4
3 files changed, 16 insertions, 5 deletions
diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java
index 96b93f9..f8316a5 100644
--- a/core/java/android/bluetooth/BluetoothUuid.java
+++ b/core/java/android/bluetooth/BluetoothUuid.java
@@ -52,7 +52,7 @@ public final class BluetoothUuid {
}
public static boolean isHandsfree(UUID uuid) {
- return uuid.equals(Handsfree) || uuid.equals(HandsfreeAudioGateway);
+ return uuid.equals(Handsfree);
}
public static boolean isHeadset(UUID uuid) {
diff --git a/core/java/android/server/BluetoothA2dpService.java b/core/java/android/server/BluetoothA2dpService.java
index 1cf7be9..722a7cc 100644
--- a/core/java/android/server/BluetoothA2dpService.java
+++ b/core/java/android/server/BluetoothA2dpService.java
@@ -104,7 +104,8 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {
break;
}
} else if (action.equals(BluetoothIntent.REMOTE_DEVICE_CONNECTED_ACTION)) {
- if (getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF) {
+ if (getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF &&
+ isSinkDevice(address)) {
// This device is a preferred sink. Make an A2DP connection
// after a delay. We delay to avoid connection collisions,
// and to give other profiles such as HFP a chance to
@@ -185,6 +186,18 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub {
return -1;
}
+ private boolean isSinkDevice(String address) {
+ String uuids[] = mBluetoothService.getRemoteUuids(address);
+ UUID uuid;
+ for (String deviceUuid: uuids) {
+ uuid = UUID.fromString(deviceUuid);
+ if (BluetoothUuid.isAudioSink(uuid)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private synchronized boolean addAudioSink (String address) {
String path = mBluetoothService.getObjectPathFromAddress(address);
String propValues[] = (String []) getSinkPropertiesNative(path);
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 38eb4d7..76906b6 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -371,9 +371,7 @@ class BluetoothEventLoop {
boolean authorized = false;
UUID uuid = UUID.fromString(deviceUuid);
- if (mBluetoothService.isEnabled() && (BluetoothUuid.isAudioSink(uuid) ||
- BluetoothUuid.isAudioSource(uuid) ||
- BluetoothUuid.isAdvAudioDist(uuid))) {
+ if (mBluetoothService.isEnabled() && BluetoothUuid.isAudioSink(uuid)) {
BluetoothA2dp a2dp = new BluetoothA2dp(mContext);
authorized = a2dp.getSinkPriority(address) > BluetoothA2dp.PRIORITY_OFF;
if (authorized) {