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

Commit 2c633792 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "api: GetConnectionState OR state of identity address" into main

parents 404e51df c27997fa
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()));
    }