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