summaryrefslogtreecommitdiffstats
path: root/core/java/android/server
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2009-08-26 09:33:40 -0700
committerNick Pelly <npelly@google.com>2009-08-26 10:46:37 -0700
commitb23d4458a91c8e77828fc38ffd81914c2e37d43a (patch)
tree4d2f2532d0bb1be09ac9483ffba73d2d918582cd /core/java/android/server
parentd497d87650dd79f7d6a4751d79598d68ceb4b789 (diff)
downloadframeworks_base-b23d4458a91c8e77828fc38ffd81914c2e37d43a.zip
frameworks_base-b23d4458a91c8e77828fc38ffd81914c2e37d43a.tar.gz
frameworks_base-b23d4458a91c8e77828fc38ffd81914c2e37d43a.tar.bz2
Fix authorization check for Audio Source.
Bluez sends the UUID of the local service being accessed in Agent.Authorize, not the remote service. So check for Audio Source not Audio Sink. In most cases this was not a problem because Bluez sends us AdvAudioDist UUID (0x110D) for incoming A2DP connections, which we already check for. This is a precautionary change.
Diffstat (limited to 'core/java/android/server')
-rw-r--r--core/java/android/server/BluetoothEventLoop.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 34d6d03..975c2ff 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -430,8 +430,10 @@ class BluetoothEventLoop {
boolean authorized = false;
UUID uuid = UUID.fromString(deviceUuid);
+ // Bluez sends the UUID of the local service being accessed, _not_ the
+ // remote service
if (mBluetoothService.isEnabled() &&
- (BluetoothUuid.isAudioSink(uuid) || BluetoothUuid.isAvrcpTarget(uuid)
+ (BluetoothUuid.isAudioSource(uuid) || BluetoothUuid.isAvrcpTarget(uuid)
|| BluetoothUuid.isAdvAudioDist(uuid))) {
BluetoothA2dp a2dp = new BluetoothA2dp(mContext);
BluetoothDevice device = mAdapter.getRemoteDevice(address);
@@ -444,6 +446,7 @@ class BluetoothEventLoop {
} else {
Log.i(TAG, "Rejecting incoming " + deviceUuid + " connection from " + address);
}
+ log("onAgentAuthorize(" + objectPath + ", " + deviceUuid + ") = " + authorized);
return authorized;
}