mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
list devices from adapter.bondedDevices (#536)
This commit is contained in:
parent
6ede4ed3bd
commit
d538c2afff
2 changed files with 15 additions and 12 deletions
|
|
@ -65,6 +65,13 @@ class BluetoothRepository @Inject constructor(
|
|||
return bluetoothAdapterLazy.get()?.bluetoothLeScanner
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
fun getBondedDevices(): Set<BluetoothDevice>? {
|
||||
return bluetoothAdapterLazy.get()
|
||||
?.takeIf { application.hasBluetoothPermission() }
|
||||
?.bondedDevices
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
internal suspend fun updateBluetoothState() {
|
||||
val newState: BluetoothState = bluetoothAdapterLazy.get()?.takeIf {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue