Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed7b44d8 authored by PauloftheWest's avatar PauloftheWest
Browse files

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
parent b5fca457
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -264,9 +264,7 @@
    <!-- Bluetooth settings screen, menu item to scan for nearby bluetooth devices -->
    <string name="bluetooth_scan_for_devices">Scan for devices</string>
    <!-- Bluetooth settings screen, menu item to change this device's Bluetooth name. [CHAR LIMIT=30] -->
    <string name="bluetooth_rename_device" product="tablet">Rename tablet</string>
    <!-- Bluetooth settings screen, menu item to change this device's Bluetooth name. [CHAR LIMIT=30] -->
    <string name="bluetooth_rename_device" product="default">Rename phone</string>
    <string name="bluetooth_rename_device">Rename this device</string>
    <!-- Bluetooth settings screen, confirmation button for rename device dialog. [CHAR LIMIT=20] -->
    <string name="bluetooth_rename_button">Rename</string>
    <!-- Bluetooth settings.  Dialog title to confirm disconnecting from all profiles of a device. [CHAR LIMIT=30] -->
+0 −1
Original line number Diff line number Diff line
@@ -178,7 +178,6 @@ public final class BluetoothNameDialogFragment extends DialogFragment implements
            mDeviceNameUpdated = true;
            mDeviceNameEdited = false;
            mDeviceNameView.setText(mLocalAdapter.getName());
            getActivity().setTitle(mLocalAdapter.getName());
        }
    }

+4 −3
Original line number Diff line number Diff line
@@ -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()));
            }
        }
    };