Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

fix: list only smart phones for scanning bluetooth devices #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.odk.share.views.ui.bluetooth;

import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -48,8 +49,10 @@ public void setDevices(List<BluetoothDevice> dateSet) {
}

public void addDevice(BluetoothDevice bluetoothDevice) {
if (!bluetoothDeviceList.contains(bluetoothDevice)) {
this.bluetoothDeviceList.add(bluetoothDevice);
if (!bluetoothDeviceList.contains(bluetoothDevice) && bluetoothDevice.getBluetoothClass().getDeviceClass() != -1) {
if (bluetoothDevice.getBluetoothClass().getDeviceClass() == BluetoothClass.Device.PHONE_SMART) {
ajay-prabhakar marked this conversation as resolved.
Show resolved Hide resolved
this.bluetoothDeviceList.add(bluetoothDevice);
}
}
notifyDataSetChanged();
}
Expand Down