feat: onboarding refresh (#2551)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich 2025-07-29 09:42:36 -05:00 committed by GitHub
parent c1408816a4
commit 2c6751a574
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 2795 additions and 2513 deletions

View file

@ -255,6 +255,11 @@ constructor(
_spinner.value = false
}
fun refreshPermissions() {
// Refresh the Bluetooth state to ensure we have the latest permissions
bluetoothRepository.refreshState()
}
@SuppressLint("MissingPermission")
fun startScan() {
debug("starting classic scan")
@ -292,7 +297,8 @@ constructor(
}
@SuppressLint("MissingPermission")
private fun requestBonding(device: BluetoothDevice) {
private fun requestBonding(it: DeviceListEntry) {
val device = bluetoothRepository.getRemoteDevice(it.address) ?: return
info("Starting bonding for ${device.anonymize}")
bluetoothRepository
@ -350,7 +356,7 @@ constructor(
changeDeviceAddress(it.fullAddress)
true
} else {
requestBonding(it.device)
requestBonding(it)
false
}
}