Loading src/com/android/bluetooth/btservice/RemoteDevices.java +6 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import java.util.LinkedList; 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 Loading Loading @@ -95,10 +95,15 @@ final class RemoteDevices { 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); } } Loading Loading
src/com/android/bluetooth/btservice/RemoteDevices.java +6 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import java.util.LinkedList; 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 Loading Loading @@ -95,10 +95,15 @@ final class RemoteDevices { 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); } } Loading