From 8acba7e09246d69bd12ff2f825b25e75acb43075 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 29 Jul 2015 06:39:03 -0700 Subject: [PATCH] add only phones and computers to list of possible BT opponent devices --- .../XWords4/src/org/eehouse/android/xw4/BTService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java index 7c986a891..640c6ddd2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java @@ -23,6 +23,7 @@ package org.eehouse.android.xw4; import android.app.Activity; import android.app.Service; import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothClass.Device.Major; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothServerSocket; @@ -974,7 +975,10 @@ public class BTService extends XWService { Set pairedDevs = m_adapter.getBondedDevices(); synchronized( m_addrs ) { 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() ); + } } } }