Merge "Skip bluetooth device iteration if LocalBluetoothManager is null"
This commit is contained in:
committed by
Android (Google) Code Review
commit
c33baa4294
@@ -443,6 +443,9 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
|
||||
|
||||
// Add cached paired BT devices
|
||||
LocalBluetoothManager lbtm = LocalBluetoothManager.getInstance(context);
|
||||
// LocalBluetoothManager.getInstance can return null if the device does not
|
||||
// support bluetooth (e.g. the emulator).
|
||||
if (lbtm != null) {
|
||||
Set<BluetoothDevice> bondedDevices =
|
||||
lbtm.getBluetoothAdapter().getBondedDevices();
|
||||
|
||||
@@ -453,7 +456,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
|
||||
data.enabled = enabled;
|
||||
result.add(data);
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user