From ed7b44d83ded493c089b2f22850a3d48d5e7e609 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Fri, 8 Aug 2014 08:36:26 -0700 Subject: [PATCH] Fixed Bluetooth renaming bug. + After renaming your Bluetooth device, the title of the Bluetooth Activity stays "Bluetooth" instead of changing to the new name. + After renaming the device, the status at the bottom Bluetooth Settings is correctly displayed. Bug: 16463239 Change-Id: Ifb12df2004fe1f89bd6f918e23c2c64ae08a0191 --- res/values/strings.xml | 4 +--- .../settings/bluetooth/BluetoothNameDialogFragment.java | 1 - src/com/android/settings/bluetooth/BluetoothSettings.java | 7 ++++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 5b0950a5a93..d2a2f5dc315 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -264,9 +264,7 @@ Scan for devices - Rename tablet - - Rename phone + Rename this device Rename diff --git a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java index bf0356c3147..b80e42ac03a 100644 --- a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java +++ b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java @@ -178,7 +178,6 @@ public final class BluetoothNameDialogFragment extends DialogFragment implements mDeviceNameUpdated = true; mDeviceNameEdited = false; mDeviceNameView.setText(mLocalAdapter.getName()); - getActivity().setTitle(mLocalAdapter.getName()); } } diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index 7441c8ca87f..4b278ac28a0 100755 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -99,13 +99,14 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED)) { - updateDeviceName(); + updateDeviceName(context); } } - private void updateDeviceName() { + private void updateDeviceName(Context context) { if (mLocalAdapter.isEnabled() && mMyDevicePreference != null) { - mMyDevicePreference.setTitle(mLocalAdapter.getName()); + mMyDevicePreference.setSummary(context.getResources().getString( + R.string.bluetooth_is_visible_message, mLocalAdapter.getName())); } } };