mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
use same CompanionDeviceManager method
This commit is contained in:
parent
3001696f9c
commit
45895cdcf6
1 changed files with 3 additions and 1 deletions
|
|
@ -113,7 +113,9 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
|
|||
@SuppressLint("NewApi", "MissingPermission")
|
||||
override fun addressValid(context: Context, rest: String): Boolean {
|
||||
val allPaired = if (hasCompanionDeviceApi(context)) {
|
||||
val deviceManager = context.getSystemService(CompanionDeviceManager::class.java)
|
||||
val deviceManager: CompanionDeviceManager by lazy {
|
||||
context.getSystemService(Context.COMPANION_DEVICE_SERVICE) as CompanionDeviceManager
|
||||
}
|
||||
deviceManager.associations.map { it }.toSet()
|
||||
} else {
|
||||
getBluetoothAdapter(context)?.bondedDevices.orEmpty()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue