diff options
author | Alisher Alikhodjaev <alisher@google.com> | 2022-05-10 20:22:28 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-10 20:22:28 +0000 |
commit | 8fb08d914b22d8be681d14140e332d7bcc8d4dbc (patch) | |
tree | af281d69835e92735e3207c0810360b7e10dce35 | |
parent | 895e4da788e443b38f3c12cfb72866da951ceed1 (diff) | |
parent | 7c7c8ca90b7cc47ae58802278300da7390eecfb1 (diff) | |
download | Nfc-8fb08d914b22d8be681d14140e332d7bcc8d4dbc.tar.gz |
Bluetooth pairing with NFC failed am: 7c7c8ca90b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Nfc/+/18282084
Change-Id: I9d3b18450378ad7d085b485ea319ad0f848be01c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | src/com/android/nfc/handover/BluetoothPeripheralHandover.java | 8 |
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; } |