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

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

Merge "Handle null identity address in BluetoothObexTransport" into main

parents 0b0aa2c5 1bf32d17
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.bluetooth;

import android.bluetooth.BluetoothSocket;

import com.android.bluetooth.flags.Flags;
import com.android.obex.ObexTransport;

import java.io.DataInputStream;
@@ -119,8 +120,12 @@ public class BluetoothObexTransport implements ObexTransport {
        if (mSocket == null) {
            return null;
        }
        String identityAddress =
                Flags.identityAddressNullIfUnknown()
                        ? Utils.getBrEdrAddress(mSocket.getRemoteDevice())
                        : mSocket.getRemoteDevice().getIdentityAddress();
        return mSocket.getConnectionType() == BluetoothSocket.TYPE_RFCOMM
                ? mSocket.getRemoteDevice().getIdentityAddress()
                ? identityAddress
                : mSocket.getRemoteDevice().getAddress();
    }