Handle DisconnectRequested message sent by Bluez.
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 4c24c50..d0d4b84 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -166,6 +166,17 @@
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) {