Merge "Fixing crash in emulator due to no BluetoothAdapter. (Bug 7188166)" into jb-mr1-dev
This commit is contained in:
@@ -96,16 +96,18 @@ public class BluetoothController extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateBondedBluetoothDevices() {
|
private void updateBondedBluetoothDevices() {
|
||||||
Set<BluetoothDevice> devices = BluetoothAdapter.getDefaultAdapter().getBondedDevices();
|
mBondedDevices.clear();
|
||||||
if (devices != null) {
|
|
||||||
mBondedDevices.clear();
|
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
||||||
for (BluetoothDevice device : devices) {
|
if (adapter != null) {
|
||||||
if (device.getBondState() != BluetoothDevice.BOND_NONE) {
|
Set<BluetoothDevice> devices = adapter.getBondedDevices();
|
||||||
mBondedDevices.add(device);
|
if (devices != null) {
|
||||||
|
for (BluetoothDevice device : devices) {
|
||||||
|
if (device.getBondState() != BluetoothDevice.BOND_NONE) {
|
||||||
|
mBondedDevices.add(device);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
mBondedDevices.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user