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

Commit f5579f16 authored by Kihong Seong's avatar Kihong Seong Committed by Automerger Merge Worker
Browse files

Merge "Handle null identity address in BluetoothSocketManagerBinder" into main...

Merge "Handle null identity address in BluetoothSocketManagerBinder" into main am: 03b97ca9 am: b0e13e9b

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



Change-Id: I380a601d9f8a85f8f9bdf15ddd9679b50530eb9b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5e46aaf2 b0e13e9b
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,