Reduce max BT device length to 246 bytes due to Bluez bug. (DO NOT MERGE)

The maximum Bluetooth device name length is 248 bytes. There are bugs in
Bluez and D-Bus that can cause the Bluetooth service to go into a reboot
loop when the device name is set to the maximum length. Changed Settings
app to limit the device name length to 246 bytes.

Bug: 3246147
Change-Id: I320fc7a9a0bfdf8067387ec8de80efccaca2b5f6
diff --git a/src/com/android/settings/bluetooth/BluetoothNamePreference.java b/src/com/android/settings/bluetooth/BluetoothNamePreference.java
index c99ab4c..ad425fc 100644
--- a/src/com/android/settings/bluetooth/BluetoothNamePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothNamePreference.java
@@ -40,7 +40,8 @@
  */
 public class BluetoothNamePreference extends EditTextPreference implements TextWatcher {
     private static final String TAG = "BluetoothNamePreference";
-    private static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 248;
+    // max. length reduced from 248 to 246 bytes to work around Bluez bug
+    private static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 246;
 
     private LocalBluetoothManager mLocalManager;