From c681e939dd6df2cdb39ab8a0edb4eb7027d33f13 Mon Sep 17 00:00:00 2001 From: Jake Hamby Date: Fri, 3 Dec 2010 17:02:02 -0800 Subject: [PATCH] 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: I2f46303cf44951f0b3907c43d4b096736f08765b --- .../android/settings/bluetooth/BluetoothNamePreference.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothNamePreference.java b/src/com/android/settings/bluetooth/BluetoothNamePreference.java index c99ab4c9982..ad425fccf88 100644 --- a/src/com/android/settings/bluetooth/BluetoothNamePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothNamePreference.java @@ -40,7 +40,8 @@ import android.widget.EditText; */ 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;