File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
sample/src/main/java/io/runtime/mcumgr/sample/viewmodel/scanner Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 20
20
import androidx .core .app .ActivityCompat ;
21
21
import androidx .lifecycle .AndroidViewModel ;
22
22
23
+ import java .util .HashSet ;
23
24
import java .util .Set ;
24
25
25
26
import javax .inject .Inject ;
@@ -74,7 +75,12 @@ public void showDevices() {
74
75
if (ActivityCompat .checkSelfPermission (getApplication (), Manifest .permission .BLUETOOTH_CONNECT ) != PackageManager .PERMISSION_GRANTED ) {
75
76
return ;
76
77
}
77
- final Set <BluetoothDevice > devices = adapter .getBondedDevices ();
78
+ final Set <BluetoothDevice > devices = new HashSet <>();
79
+ for (BluetoothDevice device : adapter .getBondedDevices ()) {
80
+ if (device .getType () != BluetoothDevice .DEVICE_TYPE_CLASSIC ) {
81
+ devices .add (device );
82
+ }
83
+ }
78
84
devicesLiveData .setDevices (devices );
79
85
if (!devices .isEmpty ()) {
80
86
scannerStateLiveData .recordFound ();
You can’t perform that action at this time.
0 commit comments