Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94a97b6c authored by Qasim Javed's avatar Qasim Javed Committed by Android (Google) Code Review
Browse files

Merge "Only cancel bonding if pair button is not pressed" into tm-dev

parents 249269c9 29b7f1d5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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,8 +86,10 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i
    @Override
    public void onDestroy() {
        super.onDestroy();
        if (!mPositiveClicked) {
            mPairingController.onCancel();
        }
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@@ -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);