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

Commit 6f0c2dc2 authored by Balraj Selvaraj's avatar Balraj Selvaraj Committed by Gerrit - the friendly Code Review server
Browse files

Bluetooth: GAP: Rejecting the empty string in Bluetooth rename

This gerrit has the fix for rejecting the empty string in bluetooth
rename dialogue as part of DONE button as well as trimming the
empty string at head and tail end of the valid string as part of
both rename tab and DONE button.

CRs-Fixed: 808842
Change-Id: I0b7472ad7777ff0b0b7e197f3c6b822e0afbb0d4
parent 7edc9a5c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public final class BluetoothNameDialogFragment extends DialogFragment implements
                .setPositiveButton(R.string.bluetooth_rename_button,
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                String deviceName = mDeviceNameView.getText().toString();
                                String deviceName = mDeviceNameView.getText().toString().trim();
                                setDeviceName(deviceName);
                            }
                        })
@@ -135,7 +135,10 @@ public final class BluetoothNameDialogFragment extends DialogFragment implements
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_DONE) {
                    setDeviceName(v.getText().toString());
                    if (v.length() != 0 && !(v.getText().toString().trim().isEmpty())) // Rejecting Empty String
                    {
                        setDeviceName(v.getText().toString().trim());
                    }
                    mAlertDialog.dismiss();
                    return true;    // action handled
                } else {