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: jhtop.kim <jhtop.kim@samsung.com>
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user