From c07d73cc926f8f623c8ba7e1ec21a65ea8865622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o?= Date: Wed, 4 Nov 2026 21:05:39 +0100 Subject: [PATCH] Show the alias the driver gave a paired Bluetooth device The car list and the wireless status messages read the device's own name, so a device renamed in Android's Bluetooth settings still showed its old name. Prefer the alias, and sort the list by the name it shows. --- .../java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt index 0e13a30..a2dd92e 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/wireless/WirelessLink.kt @@ -104,11 +104,11 @@ object WirelessLink { @SuppressLint("MissingPermission") fun pairedDevices(context: Context): List = context.getSystemService(BluetoothManager::class.java)?.adapter?.bondedDevices - ?.sortedBy { it.name ?: it.address } + ?.sortedBy { name(it) } .orEmpty() @SuppressLint("MissingPermission") - fun name(device: BluetoothDevice): String = device.name ?: device.address + fun name(device: BluetoothDevice): String = device.alias ?: device.name ?: device.address fun start(context: Context, device: BluetoothDevice) { stop(context)