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

Commit aaf8ffff authored by jhtop.kim's avatar jhtop.kim Committed by Jake Hamby
Browse files

Bluetooth : fix for handling back key during pair dialog display



- Pressing back key when pairing dialog appears infront , device shows "Pairing..."
  if we don't have any bonded device in device list.
- when press back key will perform onCancel() operation.

Change-Id: Iacd654efad455f17a5c3bb09f822d9af5a7aed7d
Signed-off-by: default avatarjhtop.kim <jhtop.kim@samsung.com>
parent bbd891d1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.widget.TextView;
import com.android.internal.app.AlertActivity;
import com.android.internal.app.AlertController;
import com.android.settings.R;
import android.view.KeyEvent;

/**
 * BluetoothPairingDialog asks the user to enter a PIN / Passkey / simple confirmation
@@ -340,6 +341,13 @@ public final class BluetoothPairingDialog extends AlertActivity implements
        mDevice.cancelPairingUserInput();
    }

    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            onCancel();
        }
        return super.onKeyDown(keyCode,event);
    }

    public void onClick(DialogInterface dialog, int which) {
        switch (which) {
            case BUTTON_POSITIVE: