mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
move disassociate to SettingsFragment
This commit is contained in:
parent
0f3135978c
commit
c04c1b4add
2 changed files with 8 additions and 16 deletions
|
|
@ -1046,6 +1046,14 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
|||
) {
|
||||
val deviceToPair: BluetoothDevice =
|
||||
data?.getParcelableExtra(CompanionDeviceManager.EXTRA_DEVICE)!!
|
||||
|
||||
// We only keep an association to one device at a time...
|
||||
deviceManager.associations.forEach { old ->
|
||||
if (deviceToPair.address != old) {
|
||||
debug("Forgetting old BLE association ${old.anonymize}")
|
||||
deviceManager.disassociate(old)
|
||||
}
|
||||
}
|
||||
scanModel.onSelected(
|
||||
myActivity,
|
||||
BTScanModel.DeviceListEntry(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue