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

Commit be6696ef authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Automerger Merge Worker
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" am: d15ff534 am: 755f6e7f am: 60210a1a

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1700140

Change-Id: I66e29d0d266670f157819002aea47cc2789a5af4
parents 111e743e 60210a1a
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -739,14 +739,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);