summaryrefslogtreecommitdiffstats
path: root/core/java/android/server/BluetoothEventLoop.java
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-12-04 15:10:54 -0800
committerJaikumar Ganesh <jaikumar@google.com>2009-12-07 15:20:31 -0800
commitb16c4f7dd92dabf0cc27438a5d3d9ebd203a38b3 (patch)
tree5fd029b5852c6888ef2e3e14a286a9657593216a /core/java/android/server/BluetoothEventLoop.java
parent084c665421502b13271e94bd0a342b0ddbbaa7ca (diff)
downloadframeworks_base-b16c4f7dd92dabf0cc27438a5d3d9ebd203a38b3.zip
frameworks_base-b16c4f7dd92dabf0cc27438a5d3d9ebd203a38b3.tar.gz
frameworks_base-b16c4f7dd92dabf0cc27438a5d3d9ebd203a38b3.tar.bz2
Add API to get Active Sinks.
Allow incoming connections only when there are no active sinks. Dr No: Eastham Bug: 2133530
Diffstat (limited to 'core/java/android/server/BluetoothEventLoop.java')
-rw-r--r--core/java/android/server/BluetoothEventLoop.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index e960491..0d0d245 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -546,12 +546,14 @@ class BluetoothEventLoop {
boolean authorized = false;
ParcelUuid uuid = ParcelUuid.fromString(deviceUuid);
+ BluetoothA2dp a2dp = new BluetoothA2dp(mContext);
+
// Bluez sends the UUID of the local service being accessed, _not_ the
// remote service
if (mBluetoothService.isEnabled() &&
(BluetoothUuid.isAudioSource(uuid) || BluetoothUuid.isAvrcpTarget(uuid)
- || BluetoothUuid.isAdvAudioDist(uuid))) {
- BluetoothA2dp a2dp = new BluetoothA2dp(mContext);
+ || BluetoothUuid.isAdvAudioDist(uuid)) &&
+ (a2dp.getNonDisconnectedSinks().size() == 0)) {
BluetoothDevice device = mAdapter.getRemoteDevice(address);
authorized = a2dp.getSinkPriority(device) > BluetoothA2dp.PRIORITY_OFF;
if (authorized) {