am d41c5776: Merge change 22768 into eclair

Merge commit 'd41c577684785eecd3ffa848aafae759e5889731' into eclair-plus-aosp

* commit 'd41c577684785eecd3ffa848aafae759e5889731':
  Fix authorization check for Audio Source.
This commit is contained in:
Nick Pelly
2009-08-26 14:05:20 -07:00
committed by Android Git Automerger

View File

@@ -430,8 +430,10 @@ class BluetoothEventLoop {
boolean authorized = false; boolean authorized = false;
UUID uuid = UUID.fromString(deviceUuid); UUID uuid = UUID.fromString(deviceUuid);
// Bluez sends the UUID of the local service being accessed, _not_ the
// remote service
if (mBluetoothService.isEnabled() && if (mBluetoothService.isEnabled() &&
(BluetoothUuid.isAudioSink(uuid) || BluetoothUuid.isAvrcpTarget(uuid) (BluetoothUuid.isAudioSource(uuid) || BluetoothUuid.isAvrcpTarget(uuid)
|| BluetoothUuid.isAdvAudioDist(uuid))) { || BluetoothUuid.isAdvAudioDist(uuid))) {
BluetoothA2dp a2dp = new BluetoothA2dp(mContext); BluetoothA2dp a2dp = new BluetoothA2dp(mContext);
BluetoothDevice device = mAdapter.getRemoteDevice(address); BluetoothDevice device = mAdapter.getRemoteDevice(address);
@@ -444,6 +446,7 @@ class BluetoothEventLoop {
} else { } else {
Log.i(TAG, "Rejecting incoming " + deviceUuid + " connection from " + address); Log.i(TAG, "Rejecting incoming " + deviceUuid + " connection from " + address);
} }
log("onAgentAuthorize(" + objectPath + ", " + deviceUuid + ") = " + authorized);
return authorized; return authorized;
} }