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