From 78765b0b26b52c837b4d8ad51e27c0d1ba06aacd Mon Sep 17 00:00:00 2001 From: Qasim Javed Date: Mon, 9 May 2022 13:11:13 -0700 Subject: [PATCH] Cancel bonding upon back gesture. When pairing dialog is dismissed using the back gesture, we do not call cancelBondProcess() for the remote device. Since bonding is not cancelled and the dialog is dismissed, when the user tries to pair again and scans for devices, nothing shows up. This is because in case of a pending bond or pending SDP, the request to search for new devices is queued. The correct behavior is to cancel bonding if the pairing dialog is dismissed using the back gesture. This is similar to what happens when the pairing dialog is dismissed using the cancel button. Bug: 231554812 Test: Changed settings app is able to scan after dismissing the dialog Change-Id: Ia790e345be811be1b60762ff819544d03c5a18fd Merged-In: Ia790e345be811be1b60762ff819544d03c5a18fd --- .../settings/bluetooth/BluetoothPairingDialogFragment.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java index 9e3624732d0..14b4a7a5a7e 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java @@ -82,6 +82,12 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i return mDialog; } + @Override + public void onDestroy() { + super.onDestroy(); + mPairingController.onCancel(); + } + @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { }