diff --git a/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt b/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt index 1eba742a1..5fdd12b3f 100644 --- a/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt +++ b/app/src/main/java/com/geeksville/mesh/service/BluetoothInterface.kt @@ -112,15 +112,14 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String /** Return true if this address is still acceptable. For BLE that means, still bonded */ @SuppressLint("NewApi", "MissingPermission") override fun addressValid(context: Context, rest: String): Boolean { - val allPaired = if (hasCompanionDeviceApi(context)) { + /* val allPaired = if (hasCompanionDeviceApi(context)) { val deviceManager: CompanionDeviceManager by lazy { context.getSystemService(Context.COMPANION_DEVICE_SERVICE) as CompanionDeviceManager } deviceManager.associations.map { it }.toSet() - } else { - getBluetoothAdapter(context)?.bondedDevices.orEmpty() + } else { */ + val allPaired = getBluetoothAdapter(context)?.bondedDevices.orEmpty() .map { it.address }.toSet() - } return if (!allPaired.contains(rest)) { warn("Ignoring stale bond to ${rest.anonymize}") false diff --git a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt index 69df4b3d3..b44a31fd1 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt @@ -813,7 +813,7 @@ class SettingsFragment : ScreenFragment("Settings"), Logging { if (curRadio != null && !MockInterface.addressValid(requireContext(), "")) { binding.warningNotPaired.visibility = View.GONE // binding.scanStatusText.text = getString(R.string.current_pair).format(curRadio) - } else { + } else if (model.bluetoothEnabled.value == true){ binding.warningNotPaired.visibility = View.VISIBLE binding.scanStatusText.text = getString(R.string.not_paired_yet) }