diff --git a/sample/src/main/java/io/runtime/mcumgr/sample/viewmodel/scanner/SavedDevicesViewModel.java b/sample/src/main/java/io/runtime/mcumgr/sample/viewmodel/scanner/SavedDevicesViewModel.java index c6eeaf1..8248c36 100644 --- a/sample/src/main/java/io/runtime/mcumgr/sample/viewmodel/scanner/SavedDevicesViewModel.java +++ b/sample/src/main/java/io/runtime/mcumgr/sample/viewmodel/scanner/SavedDevicesViewModel.java @@ -20,6 +20,7 @@ import androidx.core.app.ActivityCompat; import androidx.lifecycle.AndroidViewModel; +import java.util.HashSet; import java.util.Set; import javax.inject.Inject; @@ -74,7 +75,12 @@ public void showDevices() { if (ActivityCompat.checkSelfPermission(getApplication(), Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) { return; } - final Set devices = adapter.getBondedDevices(); + final Set devices = new HashSet<>(); + for (BluetoothDevice device : adapter.getBondedDevices()) { + if (device.getType() != BluetoothDevice.DEVICE_TYPE_CLASSIC) { + devices.add(device); + } + } devicesLiveData.setDevices(devices); if (!devices.isEmpty()) { scannerStateLiveData.recordFound();