From 3ae05ce80fff6eb698bd239788d92d6bba96d083 Mon Sep 17 00:00:00 2001 From: Cem Ali <123562519+cemaliplt@users.noreply.github.com> Date: Wed, 18 Nov 2026 05:42:58 +0300 Subject: [PATCH] android: keep device type labels across CONNECTED_DEVICES refresh What was wrong: AACPManager.kt:1251 looked up the previous type in the local 'devices' list, which is empty for each unique MAC, so existingDevice was always null and the type set by SMART_ROUTING_RESP (iPad, Mac, Linux...) was dropped on every CONNECTED_DEVICES update (line 519 replaces connectedDevices). Fix: look up the previous list, connectedDevices.find { it.mac == mac }. connectedDevices still holds the old list while parsing because line 519 assigns the result only after parseConnectedDevicesResponse returns. How checked: code reading only (origin/main 89356c0). Not built, no Android SDK available. --- .../main/java/me/kavishdevar/librepods/bluetooth/AACPManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/AACPManager.kt b/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/AACPManager.kt index ac6d356b7f..f36412a77e 100644 --- a/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/AACPManager.kt +++ b/android/app/src/main/java/me/kavishdevar/librepods/bluetooth/AACPManager.kt @@ -1248,7 +1248,7 @@ class AACPManager { val mac = macBytes.joinToString(":") { "%02X".format(it) } val info1 = data[offset + 6] val info2 = data[offset + 7] - val existingDevice = devices.find { it.mac == mac } + val existingDevice = connectedDevices.find { it.mac == mac } devices.add(ConnectedDevice(mac, info1, info2, existingDevice?.type)) offset += 8 }