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

Commit 968863e4 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8652434 from a8cef859 to tm-qpr1-release

Change-Id: I3b92e279fbe82a1dad67d36541dacf19d000f7b2
parents 12fbf7bd a8cef859
Loading
Loading
Loading
Loading
+45 −6
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.btservice.ProfileService;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;


import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashMap;
@@ -68,6 +69,7 @@ public class BassClientService extends ProfileService {


    private final Map<BluetoothDevice, BassClientStateMachine> mStateMachines = new HashMap<>();
    private final Map<BluetoothDevice, BassClientStateMachine> mStateMachines = new HashMap<>();
    private final Object mSearchScanCallbackLock = new Object();
    private final Object mSearchScanCallbackLock = new Object();
    private final Map<Integer, ScanResult> mScanBroadcasts = new HashMap<>();


    private HandlerThread mStateMachinesThread;
    private HandlerThread mStateMachinesThread;
    private HandlerThread mCallbackHandlerThread;
    private HandlerThread mCallbackHandlerThread;
@@ -325,8 +327,16 @@ public class BassClientService extends ProfileService {
    }
    }


    private boolean hasRoomForBroadcastSourceAddition(BluetoothDevice device) {
    private boolean hasRoomForBroadcastSourceAddition(BluetoothDevice device) {
        List<BluetoothLeBroadcastReceiveState> currentAllSources = getAllSources(device);
        boolean isRoomAvailable = false;
        return currentAllSources.size() < getMaximumSourceCapacity(device);
        String emptyBluetoothDevice = "00:00:00:00:00:00";
        for (BluetoothLeBroadcastReceiveState recvState: getAllSources(device)) {
            if (recvState.getSourceDevice().getAddress().equals(emptyBluetoothDevice)) {
                isRoomAvailable = true;
                break;
            }
        }
        log("isRoomAvailable: " + isRoomAvailable);
        return isRoomAvailable;
    }
    }


    private BassClientStateMachine getOrCreateStateMachine(BluetoothDevice device) {
    private BassClientStateMachine getOrCreateStateMachine(BluetoothDevice device) {
@@ -632,16 +642,29 @@ public class BassClientService extends ProfileService {
                            BassConstants.BAAS_UUID)) {
                            BassConstants.BAAS_UUID)) {
                        return;
                        return;
                    }
                    }
                    Message msg = mBassUtils.getAutoAssistScanHandler()
                    log( "Broadcast Source Found:" + result.getDevice());
                            .obtainMessage(BassConstants.AA_SCAN_SUCCESS);
                    byte[] broadcastIdArray = listOfUuids.get(BassConstants.BAAS_UUID);
                    msg.obj = result;
                    int broadcastId = (int)(((broadcastIdArray[2] & 0xff) << 16)
                    mBassUtils.getAutoAssistScanHandler().sendMessage(msg);
                            | ((broadcastIdArray[1] & 0xff) << 8)
                            | (broadcastIdArray[0] & 0xff));
                    if (mScanBroadcasts.get(broadcastId) == null) {
                        log("selectBroadcastSource: broadcastId " + broadcastId);
                        mScanBroadcasts.put(broadcastId, result);
                        synchronized (mStateMachines) {
                            for (BassClientStateMachine sm : mStateMachines.values()) {
                                if (sm.isConnected()) {
                                    selectSource(sm.getDevice(), result, false);
                                }
                            }
                        }
                    }
                }
                }


                public void onScanFailed(int errorCode) {
                public void onScanFailed(int errorCode) {
                    Log.e(TAG, "Scan Failure:" + errorCode);
                    Log.e(TAG, "Scan Failure:" + errorCode);
                }
                }
            };
            };
            mScanBroadcasts.clear();
            ScanSettings settings = new ScanSettings.Builder().setCallbackType(
            ScanSettings settings = new ScanSettings.Builder().setCallbackType(
                    ScanSettings.CALLBACK_TYPE_ALL_MATCHES)
                    ScanSettings.CALLBACK_TYPE_ALL_MATCHES)
                    .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
                    .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
@@ -687,6 +710,7 @@ public class BassClientService extends ProfileService {
            scanner.stopScan(mSearchScanCallback);
            scanner.stopScan(mSearchScanCallback);
            mSearchScanCallback = null;
            mSearchScanCallback = null;
            mCallbacks.notifySearchStopped(BluetoothStatusCodes.REASON_LOCAL_APP_REQUEST);
            mCallbacks.notifySearchStopped(BluetoothStatusCodes.REASON_LOCAL_APP_REQUEST);
            mScanBroadcasts.clear();
        }
        }
    }
    }


@@ -792,6 +816,7 @@ public class BassClientService extends ProfileService {
        }
        }
        Message message = stateMachine.obtainMessage(BassClientStateMachine.UPDATE_BCAST_SOURCE);
        Message message = stateMachine.obtainMessage(BassClientStateMachine.UPDATE_BCAST_SOURCE);
        message.arg1 = sourceId;
        message.arg1 = sourceId;
        message.arg2 = BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_INVALID;
        message.obj = updatedMetadata;
        message.obj = updatedMetadata;
        stateMachine.sendMessage(message);
        stateMachine.sendMessage(message);
    }
    }
@@ -820,6 +845,20 @@ public class BassClientService extends ProfileService {
                    BluetoothStatusCodes.ERROR_REMOTE_LINK_ERROR);
                    BluetoothStatusCodes.ERROR_REMOTE_LINK_ERROR);
            return;
            return;
        }
        }
        BluetoothLeBroadcastReceiveState recvState =
                stateMachine.getBroadcastReceiveStateForSourceId(sourceId);
        BluetoothLeBroadcastMetadata metaData =
                stateMachine.getCurrentBroadcastMetadata(sourceId);
        if (metaData != null && recvState != null && recvState.getPaSyncState() ==
                BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_SYNCHRONIZED) {
            log("Force source to lost PA sync");
            Message message = stateMachine.obtainMessage(
                    BassClientStateMachine.UPDATE_BCAST_SOURCE);
            message.arg1 = sourceId;
            message.arg2 = BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_IDLE;
            message.obj = metaData;
            stateMachine.sendMessage(message);
        }
        Message message = stateMachine.obtainMessage(BassClientStateMachine.REMOVE_BCAST_SOURCE);
        Message message = stateMachine.obtainMessage(BassClientStateMachine.REMOVE_BCAST_SOURCE);
        message.arg1 = sourceId;
        message.arg1 = sourceId;
        stateMachine.sendMessage(message);
        stateMachine.sendMessage(message);
+36 −12
Original line number Original line Diff line number Diff line
@@ -436,11 +436,13 @@ public class BassClientStateMachine extends StateMachine {
                channel.setSelected(false);
                channel.setSelected(false);
                subGroup.addChannel(channel.build());
                subGroup.addChannel(channel.build());
            }
            }
            subGroup.setCodecId((long)(baseLevel2.codecId[4] << 32
            byte[] arrayCodecId = baseLevel2.codecId;
                    | baseLevel2.codecId[3] << 24
            long codeId = (long) ((arrayCodecId[4] & 0xff) << 32
                    | baseLevel2.codecId[2] << 16
                    | (arrayCodecId[3] & 0xff) << 24
                    | baseLevel2.codecId[1] << 8
                    | (arrayCodecId[2] & 0xff) << 16
                    | baseLevel2.codecId[0]));
                    | (arrayCodecId[1] & 0xff) << 8
                    | (arrayCodecId[0] & 0xff));
            subGroup.setCodecId(codeId);
            subGroup.setCodecSpecificConfig(BluetoothLeAudioCodecConfigMetadata.
            subGroup.setCodecSpecificConfig(BluetoothLeAudioCodecConfigMetadata.
                    fromRawBytes(baseLevel2.codecConfigInfo));
                    fromRawBytes(baseLevel2.codecConfigInfo));
            subGroup.setContentMetadata(BluetoothLeAudioContentMetadata.
            subGroup.setContentMetadata(BluetoothLeAudioContentMetadata.
@@ -448,6 +450,18 @@ public class BassClientStateMachine extends StateMachine {
            metaData.addSubgroup(subGroup.build());
            metaData.addSubgroup(subGroup.build());
        }
        }
        metaData.setSourceDevice(device, device.getAddressType());
        metaData.setSourceDevice(device, device.getAddressType());
        byte[] arrayPresentationDelay = baseData.getLevelOne().presentationDelay;
        int presentationDelay = (int) ((arrayPresentationDelay[2] & 0xff) << 16
                | (arrayPresentationDelay[1] & 0xff)
                | (arrayPresentationDelay[0] & 0xff));
        metaData.setPresentationDelayMicros(presentationDelay);
        PeriodicAdvertisementResult result =
                mService.getPeriodicAdvertisementResult(device);
        if (result != null) {
            int broadcastId = result.getBroadcastId();
            log("broadcast ID: " + broadcastId);
            metaData.setBroadcastId(broadcastId);
        }
        return metaData.build();
        return metaData.build();
    }
    }


@@ -638,6 +652,7 @@ public class BassClientStateMachine extends StateMachine {
            byte metaDataSyncState = receiverState[BassConstants.BCAST_RCVR_STATE_PA_SYNC_IDX];
            byte metaDataSyncState = receiverState[BassConstants.BCAST_RCVR_STATE_PA_SYNC_IDX];
            byte encryptionStatus = receiverState[BassConstants.BCAST_RCVR_STATE_ENC_STATUS_IDX];
            byte encryptionStatus = receiverState[BassConstants.BCAST_RCVR_STATE_ENC_STATUS_IDX];
            byte[] badBroadcastCode = null;
            byte[] badBroadcastCode = null;
            int badBroadcastCodeLen = 0;
            if (encryptionStatus
            if (encryptionStatus
                    == BluetoothLeBroadcastReceiveState.BIG_ENCRYPTION_STATE_BAD_CODE) {
                    == BluetoothLeBroadcastReceiveState.BIG_ENCRYPTION_STATE_BAD_CODE) {
                badBroadcastCode = new byte[BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE];
                badBroadcastCode = new byte[BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE];
@@ -648,11 +663,12 @@ public class BassClientStateMachine extends StateMachine {
                        0,
                        0,
                        BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE);
                        BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE);
                badBroadcastCode = reverseBytes(badBroadcastCode);
                badBroadcastCode = reverseBytes(badBroadcastCode);
                badBroadcastCodeLen = BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE;
            }
            }
            byte numSubGroups = receiverState[BassConstants.BCAST_RCVR_STATE_BADCODE_START_IDX
            byte numSubGroups = receiverState[BassConstants.BCAST_RCVR_STATE_BADCODE_START_IDX
                    + BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE];
                    + badBroadcastCodeLen];
            int offset = BassConstants.BCAST_RCVR_STATE_BADCODE_START_IDX
            int offset = BassConstants.BCAST_RCVR_STATE_BADCODE_START_IDX
                    + BassConstants.BCAST_RCVR_STATE_BADCODE_SIZE + 1;
                    + badBroadcastCodeLen + 1;
            ArrayList<BluetoothLeAudioContentMetadata> metadataList =
            ArrayList<BluetoothLeAudioContentMetadata> metadataList =
                    new ArrayList<BluetoothLeAudioContentMetadata>();
                    new ArrayList<BluetoothLeAudioContentMetadata>();
            ArrayList<Long> audioSyncState = new ArrayList<Long>();
            ArrayList<Long> audioSyncState = new ArrayList<Long>();
@@ -664,7 +680,7 @@ public class BassClientStateMachine extends StateMachine {
                log("BIS index byte array: ");
                log("BIS index byte array: ");
                BassUtils.printByteArray(audioSyncIndex);
                BassUtils.printByteArray(audioSyncIndex);
                ByteBuffer wrapped = ByteBuffer.wrap(reverseBytes(audioSyncIndex));
                ByteBuffer wrapped = ByteBuffer.wrap(reverseBytes(audioSyncIndex));
                audioSyncState.add(wrapped.getLong());
                audioSyncState.add((long) wrapped.getInt());


                byte metaDataLength = receiverState[offset++];
                byte metaDataLength = receiverState[offset++];
                if (metaDataLength > 0) {
                if (metaDataLength > 0) {
@@ -1255,7 +1271,7 @@ public class BassClientStateMachine extends StateMachine {
    }
    }


    private byte[] convertBroadcastMetadataToUpdateSourceByteArray(int sourceId,
    private byte[] convertBroadcastMetadataToUpdateSourceByteArray(int sourceId,
            BluetoothLeBroadcastMetadata metaData) {
            BluetoothLeBroadcastMetadata metaData, int paSync) {
        BluetoothLeBroadcastReceiveState existingState =
        BluetoothLeBroadcastReceiveState existingState =
                getBroadcastReceiveStateForSourceId(sourceId);
                getBroadcastReceiveStateForSourceId(sourceId);
        if (existingState == null) {
        if (existingState == null) {
@@ -1287,7 +1303,9 @@ public class BassClientStateMachine extends StateMachine {
        // Source_ID
        // Source_ID
        res[offset++] = (byte) sourceId;
        res[offset++] = (byte) sourceId;
        // PA_Sync
        // PA_Sync
        if (existingState.getPaSyncState()
        if (paSync != BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_INVALID) {
            res[offset++] = (byte) paSync;
        } else if (existingState.getPaSyncState()
                == BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_SYNCHRONIZED) {
                == BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_SYNCHRONIZED) {
            res[offset++] = (byte) (0x01);
            res[offset++] = (byte) (0x01);
        } else {
        } else {
@@ -1299,7 +1317,12 @@ public class BassClientStateMachine extends StateMachine {
        // Num_Subgroups
        // Num_Subgroups
        res[offset++] = numSubGroups;
        res[offset++] = numSubGroups;
        for (int i = 0; i < numSubGroups; i++) {
        for (int i = 0; i < numSubGroups; i++) {
            int bisIndexValue = existingState.getBisSyncState().get(i).intValue();
            int bisIndexValue;
            if (paSync != BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_INVALID) {
                bisIndexValue = 0;
            } else {
                bisIndexValue = existingState.getBisSyncState().get(i).intValue();
            }
            log("UPDATE_BCAST_SOURCE: bisIndexValue : " + bisIndexValue);
            log("UPDATE_BCAST_SOURCE: bisIndexValue : " + bisIndexValue);
            // BIS_Sync
            // BIS_Sync
            res[offset++] = (byte) (bisIndexValue & 0x00000000000000FF);
            res[offset++] = (byte) (bisIndexValue & 0x00000000000000FF);
@@ -1497,9 +1520,10 @@ public class BassClientStateMachine extends StateMachine {
                case UPDATE_BCAST_SOURCE:
                case UPDATE_BCAST_SOURCE:
                    metaData = (BluetoothLeBroadcastMetadata) message.obj;
                    metaData = (BluetoothLeBroadcastMetadata) message.obj;
                    int sourceId = message.arg1;
                    int sourceId = message.arg1;
                    int paSync = message.arg2;
                    log("Updating Broadcast source" + metaData);
                    log("Updating Broadcast source" + metaData);
                    byte[] updateSourceInfo = convertBroadcastMetadataToUpdateSourceByteArray(
                    byte[] updateSourceInfo = convertBroadcastMetadataToUpdateSourceByteArray(
                            sourceId, metaData);
                            sourceId, metaData, paSync);
                    if (updateSourceInfo == null) {
                    if (updateSourceInfo == null) {
                        Log.e(TAG, "update source: source Info is NULL");
                        Log.e(TAG, "update source: source Info is NULL");
                        break;
                        break;
+4 −4
Original line number Original line Diff line number Diff line
@@ -1005,8 +1005,8 @@ public final class BluetoothAdapter {
    /**
    /**
     * Get a {@link BluetoothDevice} object for the given Bluetooth hardware
     * Get a {@link BluetoothDevice} object for the given Bluetooth hardware
     * address.
     * address.
     * <p>Valid Bluetooth hardware addresses must be upper case, in a format
     * <p>Valid Bluetooth hardware addresses must be upper case, in big endian byte order, and in a
     * such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is
     * format such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is
     * available to validate a Bluetooth address.
     * available to validate a Bluetooth address.
     * <p>A {@link BluetoothDevice} will always be returned for a valid
     * <p>A {@link BluetoothDevice} will always be returned for a valid
     * hardware address, even if this adapter has never seen that device.
     * hardware address, even if this adapter has never seen that device.
@@ -1024,8 +1024,8 @@ public final class BluetoothAdapter {
    /**
    /**
     * Get a {@link BluetoothDevice} object for the given Bluetooth hardware
     * Get a {@link BluetoothDevice} object for the given Bluetooth hardware
     * address and addressType.
     * address and addressType.
     * <p>Valid Bluetooth hardware addresses must be upper case, in a format
     * <p>Valid Bluetooth hardware addresses must be upper case, in big endian byte order, and in a
     * such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is
     * format such as "00:11:22:33:AA:BB". The helper {@link #checkBluetoothAddress} is
     * available to validate a Bluetooth address.
     * available to validate a Bluetooth address.
     * <p>A {@link BluetoothDevice} will always be returned for a valid
     * <p>A {@link BluetoothDevice} will always be returned for a valid
     * hardware address and type, even if this adapter has never seen that device.
     * hardware address and type, even if this adapter has never seen that device.
+38 −35
Original line number Original line Diff line number Diff line
@@ -690,13 +690,15 @@ public final class ScanFilter implements Parcelable {
        }
        }


        /**
        /**
         * Set filter on device address.
         * Set a scan filter on the remote device address.
         * <p>
         * The address passed to this API must be in big endian byte order. It needs to be in the
         * format of "01:02:03:AB:CD:EF". The device address can be validated using
         * {@link BluetoothAdapter#checkBluetoothAddress}. The @AddressType is defaulted to
         * {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC}.
         *
         *
         * @param deviceAddress The device Bluetooth address for the filter. It needs to be in the
         * @param deviceAddress the remote device Bluetooth address for the filter
         * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link
         * @throws IllegalArgumentException if the {@code deviceAddress} is invalid
         * BluetoothAdapter#checkBluetoothAddress}.  The @AddressType is defaulted to {@link
         * BluetoothDevice#ADDRESS_TYPE_PUBLIC}
         * @throws IllegalArgumentException If the {@code deviceAddress} is invalid.
         */
         */
        public Builder setDeviceAddress(String deviceAddress) {
        public Builder setDeviceAddress(String deviceAddress) {
            if (deviceAddress == null) {
            if (deviceAddress == null) {
@@ -707,20 +709,20 @@ public final class ScanFilter implements Parcelable {
        }
        }


        /**
        /**
         * Set filter on Address with AddressType
         * Set a scan filter on the remote device address with an address type.
         *
         * <p>
         * <p>This key is used to resolve a private address from a public address.
         * The address passed to this API must be in big endian byte order. It needs to be in the
         * format of "01:02:03:AB:CD:EF". The device address can be validated using
         * {@link BluetoothAdapter#checkBluetoothAddress}.
         *
         *
         * @param deviceAddress The device Bluetooth address for the filter. It needs to be in the
         * @param deviceAddress the remote device Bluetooth address for the filter
         * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link
         * BluetoothAdapter#checkBluetoothAddress}. May be any type of address.
         * @param addressType indication of the type of address
         * @param addressType indication of the type of address
         * e.g. {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC}
         * or {@link BluetoothDevice#ADDRESS_TYPE_RANDOM}
         *
         *
         * @throws IllegalArgumentException If the {@code deviceAddress} is invalid.
         * @throws IllegalArgumentException If the {@code deviceAddress} is invalid
         * @throws IllegalArgumentException If the {@code addressType} is invalid length
         * @throws IllegalArgumentException If the {@code addressType} is invalid length or is not
         * @throws NullPointerException if {@code deviceAddress} is null.
         * either {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} or
         * {@link BluetoothDevice#ADDRESS_TYPE_RANDOM}
         * @throws NullPointerException if {@code deviceAddress} is null
         *
         *
         * @hide
         * @hide
         */
         */
@@ -732,25 +734,25 @@ public final class ScanFilter implements Parcelable {
        }
        }


        /**
        /**
         * Set filter on Address with AddressType and the Identity Resolving Key (IRK).
         * Set a scan filter on the remote device address with an address type and the Identity
         *
         * Resolving Key (IRK).
         * <p>The IRK is used to resolve a {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC} from
         * <p>
         * a PRIVATE_ADDRESS type.
         * The address passed to this API must be either a public or random static address in big
         * endian byte order. It needs to be in the format of "01:02:03:AB:CD:EF". The device
         * address can be validated using {@link BluetoothAdapter#checkBluetoothAddress}.
         * <p>
         * The IRK is used to resolve a static address from a private address. The IRK must be
         * provided in big endian byte order.
         *
         *
         * @param deviceAddress The device Bluetooth address for the filter. It needs to be in the
         * @param deviceAddress the remote device Bluetooth address for the filter
         * format of "01:02:03:AB:CD:EF". The device address can be validated using {@link
         * BluetoothAdapter#checkBluetoothAddress}.  This Address type must only be PUBLIC OR RANDOM
         * STATIC.
         * @param addressType indication of the type of address
         * @param addressType indication of the type of address
         * e.g. {@link BluetoothDevice#ADDRESS_TYPE_PUBLIC}
         * or {@link BluetoothDevice#ADDRESS_TYPE_RANDOM}
         * @param irk non-null byte array representing the Identity Resolving Key
         * @param irk non-null byte array representing the Identity Resolving Key
         *
         *
         * @throws IllegalArgumentException If the {@code deviceAddress} is invalid.
         * @throws IllegalArgumentException If the {@code deviceAddress} is invalid
         * @throws IllegalArgumentException if the {@code irk} is invalid length.
         * @throws IllegalArgumentException if the {@code irk} is invalid length
         * @throws IllegalArgumentException If the {@code addressType} is invalid length or is not
         * @throws IllegalArgumentException If the {@code addressType} is an invalid length or is
         * PUBLIC or RANDOM STATIC when an IRK is present.
         * not PUBLIC or RANDOM STATIC
         * @throws NullPointerException if {@code deviceAddress} or {@code irk} is null.
         * @throws NullPointerException if {@code deviceAddress} or {@code irk} is null
         *
         *
         * @hide
         * @hide
         */
         */
@@ -779,9 +781,10 @@ public final class ScanFilter implements Parcelable {
         * @param irk non-null byte array representing the Identity Resolving Address; nullable
         * @param irk non-null byte array representing the Identity Resolving Address; nullable
         * internally.
         * internally.
         *
         *
         * @throws IllegalArgumentException If the {@code deviceAddress} is invalid.
         * @throws IllegalArgumentException if the {@code deviceAddress} is invalid
         * @throws IllegalArgumentException If the {@code addressType} is invalid length.
         * @throws IllegalArgumentException if the {@code addressType} is not PUBLIC or RANDOM
         * @throws NullPointerException if {@code deviceAddress} is null.
         * STATIC when an IRK is present
         * @throws NullPointerException if {@code deviceAddress} is null
         *
         *
         * @hide
         * @hide
         */
         */