AeroToss: исправлены дубли устройств на телефоне
- CompositeAndroidDiscovery: используется единый ключ device.id - Устройства из TCP и Wi-Fi Direct дедуплицируются автоматически
This commit is contained in:
@@ -36,8 +36,9 @@ class CompositeAndroidDiscovery(
|
||||
wifiDirectManager.devices
|
||||
) { tcpDevices, wifiDirectDevices ->
|
||||
val all = mutableMapOf<String, Device>()
|
||||
tcpDevices.forEach { all["tcp:${it.id}"] = it }
|
||||
wifiDirectDevices.forEach { all["wifi:${it.id}"] = it }
|
||||
// Use device ID as key for both sources - deduplicates automatically
|
||||
tcpDevices.forEach { all[it.id] = it }
|
||||
wifiDirectDevices.forEach { all[it.id] = it }
|
||||
all.values.toList()
|
||||
}.collect { _devices.value = it }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user