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

Commit e13930c2 authored by Rahul Arya's avatar Rahul Arya Committed by Cherrypicker Worker
Browse files

Fix address consolidation when creating sockets

Based on patch provided by Samsung in b/262644199.

Bug: 262644199
Test: manual
Change-Id: I66f6c8d783a06d88a370e1fe17df3c4704eae76a
(cherry picked from commit 05138246)
Merged-In: I66f6c8d783a06d88a370e1fe17df3c4704eae76a
parent fd0c04da
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.bluetooth.btservice;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.bluetooth.IBluetoothSocketManager;
import android.os.Binder;
import android.os.ParcelFileDescriptor;
@@ -49,8 +50,12 @@ class BluetoothSocketManagerBinder extends IBluetoothSocketManager.Stub {
            return null;
        }

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