mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-10-08 11:31:24 -04:00
use same CompanionDeviceManager method
This commit is contained in:
1 parent
3001696f9c
commit
45895cdcf6
1 file changed
+3
-1
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user