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

Commit c5e3d761 authored by Michał Narajowski's avatar Michał Narajowski Committed by Automerger Merge Worker
Browse files

Merge "bt: Set alias for all devices in a set" into udc-dev am: 019dfd6c

parents 005d22f4 019dfd6c
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -581,9 +581,14 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
     */
     */
    public void setName(String name) {
    public void setName(String name) {
        // Prevent getName() to be set to null if setName(null) is called
        // Prevent getName() to be set to null if setName(null) is called
        if (name != null && !TextUtils.equals(name, getName())) {
        if (name == null || TextUtils.equals(name, getName())) {
            return;
        }
        mDevice.setAlias(name);
        mDevice.setAlias(name);
        dispatchAttributesChanged();
        dispatchAttributesChanged();

        for (CachedBluetoothDevice cbd : mMemberDevices) {
            cbd.setName(name);
        }
        }
    }
    }