Merge "Only cancel bonding if pair button is not pressed" into tm-dev am: 94a97b6c59

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18285591

Change-Id: I5f2a7771c8078684aac2346ca8c1c0da5c1b59d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Qasim Javed
2022-05-11 01:45:59 +00:00
committed by Automerger Merge Worker

View File

@@ -55,6 +55,7 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
private BluetoothPairingController mPairingController;
private BluetoothPairingDialog mPairingDialogActivity;
private EditText mPairingView;
private boolean mPositiveClicked = false;
/**
* The interface we expect a listener to implement. Typically this should be done by
* the controller.
@@ -85,7 +86,9 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
@Override
public void onDestroy() {
super.onDestroy();
mPairingController.onCancel();
if (!mPositiveClicked) {
mPairingController.onCancel();
}
}
@Override
@@ -110,6 +113,7 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
mPositiveClicked = true;
mPairingController.onDialogPositiveClick(this);
} else if (which == DialogInterface.BUTTON_NEGATIVE) {
mPairingController.onDialogNegativeClick(this);