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

Commit 03b97ca9 authored by Kihong Seong's avatar Kihong Seong Committed by Gerrit Code Review
Browse files

Merge "Handle null identity address in BluetoothSocketManagerBinder" into main

parents 6e7c2c89 b9f04eb7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.ParcelFileDescriptor;
import android.os.ParcelUuid;

import com.android.bluetooth.Utils;
import com.android.bluetooth.flags.Flags;

class BluetoothSocketManagerBinder extends IBluetoothSocketManager.Stub {
    private static final String TAG = "BluetoothSocketManagerBinder";
@@ -51,13 +52,18 @@ class BluetoothSocketManagerBinder extends IBluetoothSocketManager.Stub {
            return null;
        }

        String brEdrAddress =
                Flags.identityAddressNullIfUnknown()
                        ? Utils.getBrEdrAddress(device)
                        : mService.getIdentityAddress(device.getAddress());

        return marshalFd(
                mService.getNative()
                        .connectSocket(
                                Utils.getBytesFromAddress(
                                        type == BluetoothSocket.TYPE_L2CAP_LE
                                                ? device.getAddress()
                                                : mService.getIdentityAddress(device.getAddress())),
                                                : brEdrAddress),
                                type,
                                Utils.uuidToByteArray(uuid),
                                port,