Accept new bluetooth device name on enter press.

When physical keyboard is connected, on enter press accept the new name
and dismiss the dialog.

Bug: 319621722
Test: atest BluetoothNameDialogFragmentTest
Flag: NA
Change-Id: Ibc4812ad559d65eb97156d83d2a6124893ffd3a6
This commit is contained in:
Ben Murdoch
2024-02-07 14:11:32 +00:00
parent ac869a57ad
commit fad48eddd8
2 changed files with 17 additions and 3 deletions

View File

@@ -132,7 +132,7 @@ abstract class BluetoothNameDialogFragment extends InstrumentedDialogFragment
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
setDeviceName(v.getText().toString());
if (mAlertDialog != null && mAlertDialog.isShowing()) {
mAlertDialog.dismiss();