Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +15 −16 Original line number Diff line number Diff line Loading @@ -247,30 +247,29 @@ final class RemoteDevices { DeviceProperties getDeviceProperties(BluetoothDevice device) { synchronized (mDevices) { DeviceProperties prop = mDevices.get(device.getAddress()); if (prop == null) { String mainAddress = mDualDevicesMap.get(device.getAddress()); if (mainAddress != null && mDevices.get(mainAddress) != null) { prop = mDevices.get(mainAddress); String address = mDualDevicesMap.get(device.getAddress()); // If the device is not in the dual map, use its original address if (address == null || mDevices.get(address) == null) { address = device.getAddress(); } } return prop; return mDevices.get(address); } } BluetoothDevice getDevice(byte[] address) { String addressString = Utils.getAddressStringFromByte(address); DeviceProperties prop = mDevices.get(addressString); if (prop == null) { String mainAddress = mDualDevicesMap.get(addressString); if (mainAddress != null && mDevices.get(mainAddress) != null) { prop = mDevices.get(mainAddress); String deviceAddress = mDualDevicesMap.get(addressString); // If the device is not in the dual map, use its original address if (deviceAddress == null || mDevices.get(deviceAddress) == null) { deviceAddress = addressString; } DeviceProperties prop = mDevices.get(deviceAddress); if (prop != null) { return prop.getDevice(); } return null; } return prop.getDevice(); } @VisibleForTesting DeviceProperties addDeviceProperties(byte[] address) { Loading Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +15 −16 Original line number Diff line number Diff line Loading @@ -247,30 +247,29 @@ final class RemoteDevices { DeviceProperties getDeviceProperties(BluetoothDevice device) { synchronized (mDevices) { DeviceProperties prop = mDevices.get(device.getAddress()); if (prop == null) { String mainAddress = mDualDevicesMap.get(device.getAddress()); if (mainAddress != null && mDevices.get(mainAddress) != null) { prop = mDevices.get(mainAddress); String address = mDualDevicesMap.get(device.getAddress()); // If the device is not in the dual map, use its original address if (address == null || mDevices.get(address) == null) { address = device.getAddress(); } } return prop; return mDevices.get(address); } } BluetoothDevice getDevice(byte[] address) { String addressString = Utils.getAddressStringFromByte(address); DeviceProperties prop = mDevices.get(addressString); if (prop == null) { String mainAddress = mDualDevicesMap.get(addressString); if (mainAddress != null && mDevices.get(mainAddress) != null) { prop = mDevices.get(mainAddress); String deviceAddress = mDualDevicesMap.get(addressString); // If the device is not in the dual map, use its original address if (deviceAddress == null || mDevices.get(deviceAddress) == null) { deviceAddress = addressString; } DeviceProperties prop = mDevices.get(deviceAddress); if (prop != null) { return prop.getDevice(); } return null; } return prop.getDevice(); } @VisibleForTesting DeviceProperties addDeviceProperties(byte[] address) { Loading