Merge "Only cancel bonding if pair button is not pressed" am: 33a080ad7a
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2093951 Change-Id: I9d47c60b9588236b7923a33b3c1183b60896f0e3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -55,6 +55,7 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
|
|||||||
private BluetoothPairingController mPairingController;
|
private BluetoothPairingController mPairingController;
|
||||||
private BluetoothPairingDialog mPairingDialogActivity;
|
private BluetoothPairingDialog mPairingDialogActivity;
|
||||||
private EditText mPairingView;
|
private EditText mPairingView;
|
||||||
|
private boolean mPositiveClicked = false;
|
||||||
/**
|
/**
|
||||||
* The interface we expect a listener to implement. Typically this should be done by
|
* The interface we expect a listener to implement. Typically this should be done by
|
||||||
* the controller.
|
* the controller.
|
||||||
@@ -85,8 +86,10 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
if (!mPositiveClicked) {
|
||||||
mPairingController.onCancel();
|
mPairingController.onCancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
@@ -110,6 +113,7 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
if (which == DialogInterface.BUTTON_POSITIVE) {
|
if (which == DialogInterface.BUTTON_POSITIVE) {
|
||||||
|
mPositiveClicked = true;
|
||||||
mPairingController.onDialogPositiveClick(this);
|
mPairingController.onDialogPositiveClick(this);
|
||||||
} else if (which == DialogInterface.BUTTON_NEGATIVE) {
|
} else if (which == DialogInterface.BUTTON_NEGATIVE) {
|
||||||
mPairingController.onDialogNegativeClick(this);
|
mPairingController.onDialogNegativeClick(this);
|
||||||
|
Reference in New Issue
Block a user