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

Commit c27997fa authored by Chienyuan Huang's avatar Chienyuan Huang
Browse files

api: GetConnectionState OR state of identity address

Bug: 295010253
Bug: 319471537
Test: atest net_test_btif_stack
Flag: api_get_connection_state_using_identity_address
Change-Id: I53d288f9170eb0914a0add74f7bf1e321f9c4ee8
parent 5e050787
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -6190,10 +6190,14 @@ public class AdapterService extends Service {

    int getConnectionState(BluetoothDevice device) {
        if (Flags.apiGetConnectionStateUsingIdentityAddress()) {
            int connectionState =
                    mNativeInterface.getConnectionState(getBytesFromAddress(device.getAddress()));
            final String identityAddress = device.getIdentityAddress();
            return (identityAddress == null)
                    ? mNativeInterface.getConnectionState(getBytesFromAddress(device.getAddress()))
                    : mNativeInterface.getConnectionState(getBytesFromAddress(identityAddress));
            if (identityAddress != null) {
                connectionState |=
                        mNativeInterface.getConnectionState(getBytesFromAddress(identityAddress));
            }
            return connectionState;
        }
        return mNativeInterface.getConnectionState(getBytesFromAddress(device.getAddress()));
    }