mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-10 05:26:10 +01:00
add only phones and computers to list of possible BT opponent devices
This commit is contained in:
parent
cb7b8660dc
commit
8acba7e092
1 changed files with 5 additions and 1 deletions
|
@ -23,6 +23,7 @@ package org.eehouse.android.xw4;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
|
import android.bluetooth.BluetoothClass.Device.Major;
|
||||||
import android.bluetooth.BluetoothClass;
|
import android.bluetooth.BluetoothClass;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.bluetooth.BluetoothServerSocket;
|
import android.bluetooth.BluetoothServerSocket;
|
||||||
|
@ -974,7 +975,10 @@ public class BTService extends XWService {
|
||||||
Set<BluetoothDevice> pairedDevs = m_adapter.getBondedDevices();
|
Set<BluetoothDevice> pairedDevs = m_adapter.getBondedDevices();
|
||||||
synchronized( m_addrs ) {
|
synchronized( m_addrs ) {
|
||||||
for ( BluetoothDevice dev : pairedDevs ) {
|
for ( BluetoothDevice dev : pairedDevs ) {
|
||||||
m_addrs.add( dev.getAddress() );
|
int clazz = dev.getBluetoothClass().getMajorDeviceClass();
|
||||||
|
if ( Major.PHONE == clazz || Major.COMPUTER == clazz ) {
|
||||||
|
m_addrs.add( dev.getAddress() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue