summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/nfc/handover/BluetoothPeripheralHandover.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/com/android/nfc/handover/BluetoothPeripheralHandover.java b/src/com/android/nfc/handover/BluetoothPeripheralHandover.java
index 3534c631..ec522565 100644
--- a/src/com/android/nfc/handover/BluetoothPeripheralHandover.java
+++ b/src/com/android/nfc/handover/BluetoothPeripheralHandover.java
@@ -271,8 +271,7 @@ public class BluetoothPeripheralHandover implements BluetoothProfile.ServiceList
if (mInput.getConnectionState(mDevice)
!= BluetoothProfile.STATE_DISCONNECTED) {
mHidResult = RESULT_PENDING;
- mInput.setConnectionPolicy(mDevice,
- BluetoothProfile.CONNECTION_POLICY_FORBIDDEN);
+ mDevice.disconnect();
toast(getToastString(R.string.disconnecting_peripheral));
break;
} else {
@@ -282,20 +281,17 @@ public class BluetoothPeripheralHandover implements BluetoothProfile.ServiceList
if (mHeadset.getConnectionState(mDevice)
!= BluetoothProfile.STATE_DISCONNECTED) {
mHfpResult = RESULT_PENDING;
- mHeadset.setConnectionPolicy(mDevice,
- BluetoothProfile.CONNECTION_POLICY_FORBIDDEN);
} else {
mHfpResult = RESULT_DISCONNECTED;
}
if (mA2dp.getConnectionState(mDevice)
!= BluetoothProfile.STATE_DISCONNECTED) {
mA2dpResult = RESULT_PENDING;
- mA2dp.setConnectionPolicy(mDevice,
- BluetoothProfile.CONNECTION_POLICY_FORBIDDEN);
} else {
mA2dpResult = RESULT_DISCONNECTED;
}
if (mA2dpResult == RESULT_PENDING || mHfpResult == RESULT_PENDING) {
+ mDevice.disconnect();
toast(getToastString(R.string.disconnecting_peripheral));
break;
}