Bluetooth
Last updated August 26th, 2026
This topic describes how to control Bluetooth using the Knox SDK.
Examples
Turn Bluetooth on / off
To allow users to turn Bluetooth on or off, use allowBluetooth(true). To turn off Bluetooth and prevent users from toggling it, use allowBluetooth(false).
To disable Bluetooth background services, use allowBLE with false. This completely disables Bluetooth background services, even if triggered remotely.
For example, using allowBLE(false) prevents location accuracy from accessing the connection settings.

These APIs are dependent on each other, if you set allowBLE to false, it also turns off regular Bluetooth functionality on the device. See the chart below for implementation logic.
| allowBluetooth(true) | allowbluetooth(false) | |
|---|---|---|
| allowBLE(true) | allow BT and BLE | disallow BT and allow BLE |
| allowBLE(false) | disallow BT and BLE | disallow BT and BLE |
Check if Bluetooth is enabled
RestrictionPolicy.isBluetoothEnabled();
Only allow trusted hardware to work with Bluetooth
You want to allow a trusted Bluetooth audio device using the device hardware ID.
-
Create the
EnterpriseDeviceManagerobject. -
Create the
BluetoothPolicyobject. -
Add trusted Bluetooth devices using hardware ID.
-
Block all Bluetooth devices by using a * wild card and
addBluetoothDevicestoBlackList -
Add the hardware IDs you stored in step 3 to the allowlist.
-
Set
activateBluetoothDeviceRestrictionto true.//Get BluetoothPolicy object: EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); //Add only trusted Bluetooth devices using hardware ID: List devices = new ArrayList(); devices.add("00:11:22:33:AA:BB"); devices.add("00:11:22:88:AA:CC"); //add to blocklist and allowlist bluetoothPolicy.addBluetoothDevicesToBlackList(".*"); bluetoothPolicy.addBluetoothDevicesToWhiteList(AudioDeviceHardwareId); bluetoothPolicy.activateBluetoothDeviceRestriction(true);
Only allow Bluetooth to work for calling and listening to music
You want to allow a trusted Bluetooth audio device using the device hardware ID.
//Get BluetoothPolicy object:
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy();
//Allow use of Bluetooth only for calling and listening to music.
List UUIDs = new ArrayList();
UUIDs.add(BluetoothUUID.A2DP_ADVAUDIODIST_UUID);
UUIDs.add(BluetoothUUID.HFP_UUID);
bluetoothPolicy.addBluetoothUUIDsToBlackList(".*");
bluetoothPolicy.addBluetoothUUIDsToWhiteList(UUIDs);
bluetoothPolicy.activateBluetoothUUIDRestriction(true);
Enable the Share Contacts via Bluetooth feature inside the container
setContactsSharingEnabled and isContactsSharingEnabled were deprecated in API level 30 and are no longer recommended for use.
This enhancement adds the ability to share contact information which is stored in the container. For example, a device user can call a number from their contact list inside the container by sharing the number through a Bluetooth connection with their automobile’s hands-free phone system.
There are 2 APIs to support this feature:
-
Create the
EnterpriseKnoxManagerobject. -
Get the GetContainerConfigurationPolicy from ekm.
-
Call
setContactsSharingEnabledand set totrue.EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); ContainerConfigurationPolicy ccp = kcm.getContainerConfigurationPolicy(); ccp.setContactsSharingEnabled(true)
On this page
Is this page helpful?