java.lang.Object | |
↳ | com.samsung.android.knox.bluetooth.BluetoothSecureModePolicy |
This class provides APIs to control Bluetooth Secure Mode Settings. The user cannot overwrite any
disabled settings provided by this policy.
Bluetooth secure mode enables MDM administrator to
- Enable/disable Bluetooth profiles
- Limit device discoverability and device pairing
- Device white listing based on name, class of device and UUIDs.
Bluetooth secure mode configuration takes effect after secure mode is enabled and Bluetooth is
turned ON the next time. All Bluetooth secure mode configurations are turned off when secure mode
is disabled and Bluetooth is turned ON the next time.
API level 6 |
MDM 4.0 |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since Android 10. | |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since Android 10. | |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since Android 10. | |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 30
NOTE: This API is not available since Android 10. | |||||||||||
Deprecated
in API level 33
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Deprecated in API level 33
API to add a specific device to the list of white listed devices by specifying the device configuration through name, cod and list of UUIDs. When Bluetooth secure mode is enable and device whitelist is enabled, only devices which are present in whitelist are allowed to interact with device through Bluetooth.
true
if successful else false
SecurityException | If caller does not have required permissions |
---|
Used to add devices to whitelist by specifying device configuration through friendly
name, class of device and list of UUIDs. 1. Administrator creates a list of whitelist
objects to add to whitelist. 2. Administrator adds devices to whitelist. 3. The whitelist setting takes effect after secure mode enabled and next time Bluetooth is turned ON.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { String name = "bai2ndGen"; int cod = BluetoothClass.Device.Major.UNCATEGORIZED; String uuids[] = { "00001101-0000-1000-8000-00805f9b34fb", "00001200-0000-1000-8000-00805f9b34fb" }; BluetoothSecureModeWhitelistConfig whiteListConfig = new BluetoothSecureModeWhitelistConfig(); whiteListConfig.name = name; whiteListConfig.cod = cod; whiteListConfig.uuids = uuids; boolean result = bluetoothSecureModePolicy .addBluetoothDevicesToWhiteList(whiteListConfig); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH_SECUREMODE" permission which has a protection level of signature. |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated
in API level 30
NOTE: This API is not available since Android 10.
API to disable secure mode, if it is enabled. All profiles are reset on disabling secure mode
and set to false
.
If any device configurations are white listed, all whitelists are cleared on disable secure
mode.
true
if successful else false
SecurityException | If caller does not have required permissions |
---|
Used to disable secure mode on device and clear all blocked Bluetooth profiles and
white listed devices. 1. Administrator disables secure mode. 2. Administrator resets Bluetooth for secure mode settings to be cleared.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { boolean result = bluetoothSecureModePolicy.disableSecureMode(); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH_SECUREMODE" permission which has a protection level of signature. |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated in API level 33
API to enable or disable device whitelist to check for white listed devices when Bluetooth secure mode is enabled. If device whitelist is enabled, only devices whose configuration has been added to whitelist are allowed to interact through Bluetooth.
enable | boolean value to enable or disable whitelist |
---|
true
if successful else false
SecurityException | If caller does not have required permissions |
---|
Used to enable/disable checking for white listed devices while Bluetooth secure mode
is enabled. 1. Administrator enables/disables device white listing. 2. The whitelist setting takes effect after secure mode enabled and next time Bluetooth is turned ON
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { boolean result = bluetoothSecureModePolicy.enableDeviceWhiteList(); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH_SECUREMODE" permission which has a protection level of signature. |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated
in API level 30
NOTE: This API is not available since Android 10.
API to enable secure mode, with the settings configured by administrator. Administrator can configure which Bluetooth profiles to enable/disable on enabling secure mode. Administrator can choose to enable/disable device white listed while enabling secure mode. Administrator can also create a device whitelist allowing specific device configurations which will be checked when device white listed is enabled.
configObj | Object specifying boolean values for every Bluetooth profile set by administrator |
---|---|
whiteList | List of device configurations to be added to whitelist while enabling secure mode |
true
if successful else false
SecurityException | If caller does not have required permissions |
---|
Used to enable secure mode and configure which Bluetooth profiles are allowed or
disallowed and also whitelist specific device configurations which are allowed to interact
through Bluetooth. 1. Administrator selects which profiles are to be enabled. 2. Administrator selects if scan mode, pairing mode, white listing is to be enabled and creates a configuration object config which stores
required settings. 3. Administrator enters devices into whitelist if needed. 4. Administrator enables secure mode. 5. Administrator resets Bluetooth for secure mode settings to take effect. 6. For every Bluetooth profile, the cumulative strictest value set through Bluetooth Secure Mode Policy and Bluetooth Policy will be applied and enforced on device.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { BluetoothSecureModeConfig config = new BluetoothSecureModeConfig(); config.scanEnable = true; config.a2dpEnable = true; config.whitelistEnable = true; BluetoothSecureModeWhitelist whitelist = new BluetoothSecureModeWhitelist(); String name = "bai2ndGen"; int cod = BluetoothClass.Device.Major.UNCATEGORIZED; String uuids[] = { "00001101-0000-1000-8000-00805f9b34fb", "00001200-0000-1000-8000-00805f9b34fb" }; whiteListConfig.name = name; whiteListConfig.cod = cod; whiteListConfig.uuids = uuids; boolean result = bluetoothSecureModePolicy.enableSecureMode(config, whitelist); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH_SECUREMODE" permission which has a protection level of signature. |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated in API level 33
API to retrieve the device configuration for each device that has been added to the whitelist in Bluetooth secure mode.
Used to get list of devices configurations that have been added to Bluetooth secure
mode whitelist.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { BluetoothSecureModeWhitelistConfig config = bluetoothSecureModePolicy .getBluetoothDeviceFromWhiteList(); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated
in API level 30
NOTE: This API is not available since Android 10.
API to retrieve the current secure mode configuration for all profiles.
Used to retrieve the current configuration set by administrator while enabling
Bluetooth secure mode.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { BluetoothSecureModeConfig config = bluetoothSecureModePolicy .getSecureModeConfiguration(); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated in API level 33
API to check if device whitelist is enabled in Bluetooth secure mode.
true
if successful else false
Used to check if device white listing is enabled in Bluetooth secure mode.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { boolean result = bluetoothSecureModePolicy.isDeviceWhiteListEnabled(); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated
in API level 30
NOTE: This API is not available since Android 10.
API to check if Bluetooth secure mode is currently enabled .
true
if successful else false
Used to check if Bluetooth secure ode is currently enabled.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { boolean result = bluetoothSecureModePolicy.isSecureModeEnabled(); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
Global Scope |
API level 6 |
MDM 4.0 |
Deprecated in API level 33
API to remove a specific device from the list of white listed devices by specifying the device configuration through name, cod and list of UUIDs.
true
if successful else false
SecurityException | If caller does not have required permissions |
---|
Used to remove devices from whitelist in Bluetooth secure mode. 1. Administrator creates a list of whitelist
objects to remove from whitelist. 2. Administrator removes devices from whitelist. 3. The whitelist setting takes effect after secure mode enabled and next time Bluetooth is turned ON.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothSecureModePolicy bluetoothSecureModePolicy = edm.getBluetoothSecureModePolicy(); try { String name = "bai2ndGen"; int cod = BluetoothClass.Device.Major.UNCATEGORIZED; String uuids[] = { "00001101-0000-1000-8000-00805f9b34fb", "00001200-0000-1000-8000-00805f9b34fb" }; BluetoothSecureModeWhitelistConfig whiteListConfig = new BluetoothSecureModeWhitelistConfig(); whiteListConfig.name = name; whiteListConfig.cod = cod; whiteListConfig.uuids = uuids; boolean result = bluetoothSecureModePolicy .removeBluetoothDevicesFromWhiteList(whiteListConfig); } catch (RemoteException e) { Log.w(TAG, "RemoteException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH_SECUREMODE" permission which has a protection level of signature. |
Global Scope |
API level 6 |
MDM 4.0 |