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

Commit 7f468305 authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

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

Tag: #feature
Bug: 187157597
Test: Manual
Change-Id: Id26a9aa1e65c32c04bcc71702f760106b1f4494f
parent b76c52c3
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);