Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb694399 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix deadlock of mObject and mDevices in RemoteDevices"

parents 9ba86b85 17bdd40f
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -79,7 +79,8 @@ final class RemoteDevices {
                case MESSAGE_UUID_INTENT:
                case MESSAGE_UUID_INTENT:
                    BluetoothDevice device = (BluetoothDevice) msg.obj;
                    BluetoothDevice device = (BluetoothDevice) msg.obj;
                    if (device != null) {
                    if (device != null) {
                        sendUuidIntent(device);
                        DeviceProperties prop = getDeviceProperties(device);
                        sendUuidIntent(device, prop);
                    }
                    }
                    break;
                    break;
            }
            }
@@ -365,8 +366,7 @@ final class RemoteDevices {
        }
        }
    }
    }


    private void sendUuidIntent(BluetoothDevice device) {
    private void sendUuidIntent(BluetoothDevice device, DeviceProperties prop) {
        DeviceProperties prop = getDeviceProperties(device);
        Intent intent = new Intent(BluetoothDevice.ACTION_UUID);
        Intent intent = new Intent(BluetoothDevice.ACTION_UUID);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.putExtra(BluetoothDevice.EXTRA_UUID, prop == null ? null : prop.mUuids);
        intent.putExtra(BluetoothDevice.EXTRA_UUID, prop == null ? null : prop.mUuids);
@@ -545,7 +545,7 @@ final class RemoteDevices {
                            }
                            }
                            device.mUuids = newUuids;
                            device.mUuids = newUuids;
                            if (sAdapterService.getState() == BluetoothAdapter.STATE_ON) {
                            if (sAdapterService.getState() == BluetoothAdapter.STATE_ON) {
                                sendUuidIntent(bdDevice);
                                sendUuidIntent(bdDevice, device);
                            }
                            }
                            break;
                            break;
                        case AbstractionLayer.BT_PROPERTY_TYPE_OF_DEVICE:
                        case AbstractionLayer.BT_PROPERTY_TYPE_OF_DEVICE: