summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-10-23 03:17:34 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-23 03:17:34 -0700
commitfee6919e152c31f28ae9191963ffb37dbd3ebac8 (patch)
treefa044805fc0810076628e6839b8c751b5976e33d /src/com/android/settings/bluetooth
parent36c29193bc129d903b23bb2d8cfabf521cc3cd44 (diff)
parent31fcda1e3a5d01fa57c93a24a40fa280a723123b (diff)
downloadpackages_apps_Settings-fee6919e152c31f28ae9191963ffb37dbd3ebac8.tar.gz
packages_apps_Settings-fee6919e152c31f28ae9191963ffb37dbd3ebac8.tar.bz2
packages_apps_Settings-fee6919e152c31f28ae9191963ffb37dbd3ebac8.zip
Merge "Bluetooth: GAP: Rejecting the empty string in Bluetooth rename"
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r--src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
index 293a53e49..1b1b13054 100644
--- a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
@@ -100,7 +100,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);
}
})
@@ -137,7 +137,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 {