diff options
Diffstat (limited to 'src/com/android/bluetooth/map/BluetoothMapService.java')
-rw-r--r-- | src/com/android/bluetooth/map/BluetoothMapService.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java index e94af3d30..262ab70f4 100644 --- a/src/com/android/bluetooth/map/BluetoothMapService.java +++ b/src/com/android/bluetooth/map/BluetoothMapService.java @@ -273,17 +273,19 @@ public class BluetoothMapService extends ProfileService { Set<BluetoothDevice> bondedDevices = mAdapter.getBondedDevices(); int connectionState; synchronized (this) { - for (BluetoothDevice device : bondedDevices) { - ParcelUuid[] featureUuids = device.getUuids(); - if (!BluetoothUuid.containsAnyUuid(featureUuids, MAP_UUIDS)) { - continue; - } - connectionState = getConnectionState(device); - for(int i = 0; i < states.length; i++) { - if (connectionState == states[i]) { - deviceList.add(device); - } - } + if (bondedDevices != null) { + for (BluetoothDevice device : bondedDevices) { + ParcelUuid[] featureUuids = device.getUuids(); + if (!BluetoothUuid.containsAnyUuid(featureUuids, MAP_UUIDS)) { + continue; + } + connectionState = getConnectionState(device); + for(int i = 0; i < states.length; i++) { + if (connectionState == states[i]) { + deviceList.add(device); + } + } + } } } return deviceList; |