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

Commit 53b1dc1c authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Send ACTION_ALIAS_CHANGED when remote device alias is changed

Bug: 20341903
Change-Id: I6e9dbeb1d05bdcce56fab63ccdd701138c99f5a0
parent 3d10f542
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1641,7 +1641,7 @@ public class AdapterService extends Service {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(device);
        if (deviceProp == null) return false;
        deviceProp.setAlias(name);
        deviceProp.setAlias(device, name);
        return true;
    }

+5 −1
Original line number Diff line number Diff line
@@ -174,11 +174,15 @@ final class RemoteDevices {
        /**
         * @param mAlias the mAlias to set
         */
        void setAlias(String mAlias) {
        void setAlias(BluetoothDevice device, String mAlias) {
            synchronized (mObject) {
                this.mAlias = mAlias;
                mAdapterService.setDevicePropertyNative(mAddress,
                    AbstractionLayer.BT_PROPERTY_REMOTE_FRIENDLY_NAME, mAlias.getBytes());
                Intent intent = new Intent(BluetoothDevice.ACTION_ALIAS_CHANGED);
                intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
                intent.putExtra(BluetoothDevice.EXTRA_NAME, mAlias);
                mAdapterService.sendBroadcast(intent, AdapterService.BLUETOOTH_PERM);
            }
        }