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

Commit be782357 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: fbfa73cd

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

Change-Id: I32c7ab349e72f16ded98eb7c027ce1325063c364
parents 239b0f87 fbfa73cd
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);