import java.util.Queue;
final class RemoteDevices {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "BluetoothRemoteDevices";
// Maximum number of device properties to remember
prop.mAddress = address;
String key = Utils.getAddressStringFromByte(address);
DeviceProperties pv = mDevices.put(key, prop);
+
if (pv == null) {
mDeviceQueue.offer(key);
if (mDeviceQueue.size() > MAX_DEVICE_QUEUE_SIZE) {
String deleteKey = mDeviceQueue.poll();
+ for (BluetoothDevice device : mAdapterService.getBondedDevices()) {
+ if (device.getAddress().equals(deleteKey)) return prop;
+ }
+ debugLog("Removing device " + deleteKey + " from property map");
mDevices.remove(deleteKey);
}
}