am e291ee80: am 7ff269f3: Merge change 24735 into eclair

Merge commit 'e291ee80006e2c91480d1d856a3771ec6b7c2cc8'

* commit 'e291ee80006e2c91480d1d856a3771ec6b7c2cc8':
  Handle DisconnectRequested message sent by Bluez.
This commit is contained in:
Jaikumar Ganesh
2009-09-15 13:16:23 -07:00
committed by Android Git Automerger
2 changed files with 22 additions and 0 deletions

View File

@@ -166,6 +166,17 @@ class BluetoothEventLoop {
mContext.sendBroadcast(intent, BLUETOOTH_PERM);
}
private void onDeviceDisconnectRequested(String deviceObjectPath) {
String address = mBluetoothService.getAddressFromObjectPath(deviceObjectPath);
if (address == null) {
Log.e(TAG, "onDeviceDisconnectRequested: Address of the remote device in null");
return;
}
Intent intent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED);
intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mAdapter.getRemoteDevice(address));
mContext.sendBroadcast(intent, BLUETOOTH_PERM);
}
private void onCreatePairedDeviceResult(String address, int result) {
address = address.toUpperCase();
if (result == BluetoothDevice.BOND_SUCCESS) {