summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-11-04 10:31:26 -0800
committerSteve Kondik <steve@cyngn.com>2015-11-04 10:31:26 -0800
commit3dbac3fff036f5a464f6322200c59f9934ebf610 (patch)
tree277dcac934efb860da4d57037db1c0acd31c2ff9 /src/com/android/settings/bluetooth
parent8aead8b15627ad94a18a94b7ecbd8732b2bd5408 (diff)
parent31632b5326af6ebf58e75feae7802cfc5322e856 (diff)
downloadpackages_apps_Settings-3dbac3fff036f5a464f6322200c59f9934ebf610.tar.gz
packages_apps_Settings-3dbac3fff036f5a464f6322200c59f9934ebf610.tar.bz2
packages_apps_Settings-3dbac3fff036f5a464f6322200c59f9934ebf610.zip
Merge branch 'LA.BF64.1.2.2_rb4.6' of git://codeaurora.org/platform/packages/apps/Settings into cm-13.0
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r--src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java7
-rwxr-xr-xsrc/com/android/settings/bluetooth/BluetoothPairingDialog.java8
2 files changed, 9 insertions, 6 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 {
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
index cb06d5d3e..456b7e93d 100755
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -212,8 +212,8 @@ public final class BluetoothPairingDialog extends AlertActivity implements
}
}
});
- if (mDevice.getBluetoothClass().getDeviceClass()
- == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
+ if ((mDevice.getBluetoothClass() != null) && (mDevice.getBluetoothClass().getDeviceClass()
+ == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE)) {
contactSharing.setVisibility(View.VISIBLE);
} else {
contactSharing.setVisibility(View.GONE);
@@ -284,8 +284,8 @@ public final class BluetoothPairingDialog extends AlertActivity implements
}
}
});
- if (mDevice.getBluetoothClass().getDeviceClass()
- == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
+ if ((mDevice.getBluetoothClass() != null) && (mDevice.getBluetoothClass().getDeviceClass()
+ == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE)) {
contactSharing.setVisibility(View.VISIBLE);
} else {
contactSharing.setVisibility(View.GONE);