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

Commit d15ff534 authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Gerrit Code Review
Browse files

Merge "Fetching UUIDs with SDP now either returns the cached UUIDs or waits...

Merge "Fetching UUIDs with SDP now either returns the cached UUIDs or waits for SDP to be performed by the stack once the device is bonded"
parents c4f2e63e 7f468305
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -696,14 +696,24 @@ final class RemoteDevices {
        if (sSdpTracker.contains(device)) {
            return;
        }

        // If no UUIDs are cached and the device is bonding, wait for SDP after the device is bonded
        boolean isBonding = getDeviceProperties(device).isBonding();
        if (isBonding && getDeviceProperties(device).getUuids() == null) {
            return;
        }

        sSdpTracker.add(device);

        Message message = mHandler.obtainMessage(MESSAGE_UUID_INTENT);
        message.obj = device;
        mHandler.sendMessageDelayed(message, UUID_INTENT_DELAY);

        // Uses cached UUIDs if we are bonding. If not, we fetch the UUIDs with SDP.
        if (!isBonding) {
            sAdapterService.getRemoteServicesNative(Utils.getBytesFromAddress(device.getAddress()));
        }
    }

    void updateUuids(BluetoothDevice device) {
        Message message = mHandler.obtainMessage(MESSAGE_UUID_INTENT);