Getting following error while bluetooth connection (After migration from Knox Premium SDK to Knox SDK)

"Unable to pair with Device-XXXXX" Incorrect PIN or password"

Please check below code -

BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy();
ArrayList<String> devices = new ArrayList<String>();
devices.add("*****");
devices.add("*****");
bluetoothPolicy.clearBluetoothDevicesFromWhiteList();
bluetoothPolicy.addBluetoothDevicesToWhiteList(devices, true);
boolean resp = bluetoothPolicy.activateBluetoothDeviceRestriction(true);

BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy();
List<BluetoothSecureModeWhitelistConfig> list = new ArrayList<BluetoothSecureModeWhitelistConfig>();
boolean result = false;
BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy();
        

try {
    BluetoothSecureModeConfig config = new BluetoothSecureModeConfig();
    config.scanMode = true;
    config.a2dpEnable = true;
    config.whitelistEnable = true;
    BluetoothSecureModeWhitelistConfig whiteListConfig = new BluetoothSecureModeWhitelistConfig();

    String name = "bai2ndGen";
    int cod = BluetoothClass.Device.Major.UNCATEGORIZED;

    String uuids[] = {  "00001101-0000-1000-8000-00805f9b34fb" };
    whiteListConfig.name = name;
    whiteListConfig.cod = cod;
    whiteListConfig.uuids = uuids;
    list.add(whiteListConfig);
    result = bluetoothSecureModePolicy.enableSecureMode(
            config, list);
} catch (Exception e) {
    DvBancLog.e( e.toString());
}

 

Thanks