androidbluetoothsettingsdevicebond

Android get bluetooth device new name changed in bluetooth settings


How can I get the new name of a bonded device that was changed in the Bluetooth settings? Is it possible to track this change?

I checked:

val adapter = context.getSystemService<BluetoothManager>()?.adapter

  1. adapter.bondedDevices.forEach {it.name} - name does not change (and after restarting the phone and reconnecting the device)
  2. adapter.getRemoteDevice("2C:4D:79:C2:46:E7").name - name does not change
  3. receiver + IntentFilter(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED) - here all works, the PHONE name changes, but i need a similar mechanism for bluetooth bonded devices

Bluetooth bonded devices Bluetooth bonded devices Bluetooth device settings Bluetooth device settings


Solution

  • adapter.bondedDevices.forEach {it.alias} ...