java.lang.Object | |
↳ | com.samsung.android.knox.bluetooth.BluetoothPolicy |
This class provides APIs to control Bluetooth settings. The user cannot overwrite any disabled
settings provided by this policy.
NOTE:
If Bluetooth Secure mode is enabled, the strictest configuration for all Bluetooth profiles
cumulatively set by Bluetooth Policy and Bluetooth Secure Mode Policy will be enforced on device.
Please see BluetoothSecureModePolicy
API level 2 |
MDM 2.0 |
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BluetoothPolicy.BluetoothProfile | This class provides Bluetooth profiles that can be managed by administrators. | ||||||||||
BluetoothPolicy.BluetoothUUID | This class provides Bluetooth UUIDs that an administrator can manage. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
API to enable or disable Bluetooth device restriction.
| |||||||||||
Deprecated
in API level 36
| |||||||||||
API to add devices to the Bluetooth device blacklist.
| |||||||||||
API to add a device to the Bluetooth device whitelist.
| |||||||||||
API to add a device to the Bluetooth device whitelist along with blacklist all other devices,
if defaultBlackList is
true . | |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
API to allow or disallow caller Id display on a connected Bluetooth device.
| |||||||||||
API to allow or disallow outgoing calls via a Bluetooth headset.
| |||||||||||
API for removing all devices from the Bluetooth device blacklist.
| |||||||||||
API for removing all devices from the Bluetooth device blacklist and whitelist.
| |||||||||||
API for removing all devices from the Bluetooth device whitelist.
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
API for retrieving the list of blacklisted Bluetooth devices for all administrators.
| |||||||||||
API for retrieving the list of whitelisted Bluetooth devices for all administrators.
| |||||||||||
API to get the Bluetooth log stored on the device.
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
API to get active state of the Bluetooth device restriction.
| |||||||||||
API to check whether the Bluetooth log is enabled.
| |||||||||||
Deprecated
in API level 36
| |||||||||||
API to get caller Id display status on a connected Bluetooth device.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
API to check whether discoverable mode is enabled.
| |||||||||||
API to check whether limited discoverable mode is enabled.
| |||||||||||
API to check whether outgoing calls are allowed via a Bluetooth headset.
| |||||||||||
API to check whether Bluetooth pairing is enabled.
| |||||||||||
API to check whether a specific Bluetooth profile is enabled.
| |||||||||||
API for removing a device from the Bluetooth device blacklist.
| |||||||||||
API for removing a device from the Bluetooth device whitelist.
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
Deprecated
in API level 36
| |||||||||||
API to enable or disable the Bluetooth log feature.
| |||||||||||
Deprecated
in API level 35
| |||||||||||
API to enable or disable Bluetooth discoverable mode.
| |||||||||||
API to enable or disable limited discoverable mode.
| |||||||||||
API to enable or disable Bluetooth pairing with other Bluetooth devices.
| |||||||||||
API to enable or disable a specific Bluetooth profile.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
API to enable or disable Bluetooth device restriction.
enable | true to enable, false to disable |
---|
true
on success, false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can call this API to activate or deactivate Bluetooth blacklist and whitelist device restrictions. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to activate or deactivate Bluetooth UUID restrictions.
enable | true to enable, false to disable |
---|
true
on success, else false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability between devices during communication. An administrator can use this API to activate or deactivate Bluetooth blacklist and whitelist UUID restrictions. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to add devices to the Bluetooth device blacklist.
devices | Bluetooth device to be added to blacklist |
---|
true
if the device was successfully added to the blacklist, else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to blacklist connections based on the Bluetooth device.
Connections with matching device are prevented. The device is identified by the MAC address.
During specification, only the "*" wildcard is allowed, which blacklists all devices except
those in the whitelist. The blacklist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); //device to be removed from black list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to add a device to the Bluetooth device whitelist.
devices | Bluetooth device to be added to whitelist |
---|
true
if the device was successfully added to the whitelist else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to add connections to a whitelist based on the Bluetooth
device. A connection with a matching device is an exception from the blacklist. During
specification, only the "*" wildcard is allowed, which adds all devices to the whitelist. If
the same UUID is present in the whitelist and blacklist and was added by same administrator,
the whitelist takes priority. The whitelist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); //device to be removed from white list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to add a device to the Bluetooth device whitelist along with blacklist all other devices,
if defaultBlackList is true
.
devices | Bluetooth device to be added to whitelist |
---|---|
defaultBlackList | If true then by default all the devices are blacklisted
except whitelisted devices. Bluetooth device to be added to whitelist |
true
if the device was successfully added to the whitelist else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to add connections to a whitelist based on the Bluetooth
device. If defaultBlackList is
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); //device to be removed from white list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
Global Scope |
Deprecated in API level 36
API to add UUIDs to the Bluetooth UUID blacklist.
UUIDs | Bluetooth UUIDs to be added to blacklist |
---|
true
if the UUID successfully added to blacklist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices. For interoperability, two
communicating devices must implement a common profile. An administrator can use this API to
blacklist connections based on Bluetooth UUIDs. Connections with matching UUID are prevented.
During specification, only the "*" Wildcard is allowed, which blacklists all UUIDs except
those in the whitelist. The blacklist is in effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); // UUIDs to be removed from black list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to add UUIDs to the Bluetooth UUID whitelist.
UUIDs | Bluetooth UUIDs to be added to whitelist |
---|
true
if the UUID successfully added to whitelist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability
between devices during communication. This API is used to add UUIDs to the Bluetooth UUID
whitelist. Connections with matching UUIDs become exceptions from the blacklist. During
specification, only the "*" Wild card is allowed, which whitelists all UUIDs. If the same
UUID is present in the whitelist and blacklist and has been added by the same administrator,
the whitelist takes preference. The whitelist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); // UUID to be removed from whitelist. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to add UUIDs to the Bluetooth UUID whitelist along with blacklist all other UUIDs, if
defaultBlackList is true
.
UUIDs | Bluetooth UUIDs to be added to whitelist |
---|---|
defaultBlackList | If true then by default all the UUID's are blacklisted
except the whitelisted UUID's. |
true
if the UUID successfully added to whitelist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability
between devices during communication. An effectively can use this API to add UUIDs to the
Bluetooth UUID whitelist. if defaultBlacklist is
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); // UUID to be removed from whitelist. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
Global Scope |
API to allow or disallow caller Id display on a connected Bluetooth device.
allow | true to allow caller Id display, false to not display
caller Id. |
---|
true
on success, else false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to allow or disallow caller Id information on a
connected Bluetooth device during an incoming call.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { if (bluetoothPolicy.allowCallerIDDisplay(false)) { Log.d(TAG, "Caller Id display blocked successfully"); } else { Log.d(TAG, "Failed to block caller Id display"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
Global Scope |
API to allow or disallow outgoing calls via a Bluetooth headset.
allow | true to allow, false to disallow |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to block call transfer to any Bluetooth headset.
When this policy is applied, the device can still be discovered and paired. The Bluetooth
headset can still control call origination and termination. The policy does not affect
incoming calls using a Bluetooth headset. NOTE: From Android 4.2, this API will block both incoming and outgoing calls. EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.allowOutgoingCalls(false); if (true == result) { // administered device cannot be connected to Bluetooth headset. } else { // default behaviour. Can be connected to a Bluetooth Headset if // not overridden previously. } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API for removing all devices from the Bluetooth device blacklist.
true
if all the devices successfully cleared from the blacklist else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all Bluetooth devices from the blacklist. The
blacklist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.clearBluetoothDevicesFromBlackList(); if (true == result) { // all devices cleared from blacklist } else { // devices not cleared from blacklist } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API for removing all devices from the Bluetooth device blacklist and whitelist.
true
if all the devices successfully cleared from the blacklist and
whitelist else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all Bluetooth devices from the blacklist and
whitelist. The blacklist and whitelist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.clearBluetoothDevicesFromList(); if (true == result) { // all devices cleared from blacklist and whitelist } else { // devices not cleared from blacklist and whitelist } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
Global Scope |
API for removing all devices from the Bluetooth device whitelist.
true
if all the devices successfully cleared from the whitelist else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all Bluetooth devices from the whitelist. The
whitelist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.clearBluetoothDevicesFromWhiteList(); if (true == result) { // all devices cleared from the whitelist } else { // devices not cleared from the whitelist } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to clear all UUIDs from Bluetooth UUID blacklist.
true
if the UUIDs are successfully cleared from blacklist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability
between devices during communication. This API removes all Bluetooth UUIDs from the blacklist
for calling administrators. The blacklist is in effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.clearBluetoothUUIDsFromBlackList(); if (true == result) { // all UUIDs successfully cleared from blacklist } else { // all UUIDs not cleared from blacklist } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to clear all UUIDs from Bluetooth UUID blacklist and whitelist.
true
if the UUIDs are successfully cleared from blacklist and whitelist,
else false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability
between devices during communication. This API removes all Bluetooth UUIDs from the blacklist
and whitelist for calling administrators. The blacklist and whitelist is in effect only after
being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.clearBluetoothUUIDsFromList(); if (true == result) { // all UUIDs successfully cleared from blacklist and whitelist } else { // all UUIDs not cleared from blacklist and whitelist } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
Global Scope |
Deprecated in API level 36
API to clear all UUIDs from Bluetooth UUID whitelist.
true
if the UUIDs are successfully cleared from whitelist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability
between devices during communication. An administrator can use this API to remove all
Bluetooth UUIDs from the whitelist. All exceptions due to the whitelist are removed for the
same administrator. The whitelist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.clearBluetoothUUIDsFromWhiteList(); if (true == result) { // all UUIDs cleared from whitelist } else { // all UUIDs not cleared from whitelist } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to check whether file sharing via Bluetooth is allowed.
true
if file sharing via Bluetooth is allowed, false
if
file sharing via Bluetooth is disallowedAPI level 2 |
MDM 2.0 |
Global Scope |
API for retrieving the list of blacklisted Bluetooth devices for all administrators.
null
if operation failed.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the list of blacklisted devices. Connections with matching devices are prevented. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API for retrieving the list of whitelisted Bluetooth devices for all administrators.
null
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the list of whitelisted devices for all administrators. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to get the Bluetooth log stored on the device.
null
on failure.SecurityException | If caller does not have required permissions |
---|
An administrator can call this API to get log contents. The log size is limited to
1000 entries (the newest entries rewrite the oldest entries). The log is automatically
cleared when this policy is disabled.
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 5 |
MDM 3.0 |
Global Scope |
Deprecated in API level 36
API to retrieve the list of blacklisted Bluetooth UUIDs for all administrators.
null
.SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability between devices during communication. An administrator can use this API to get the list of UUIDs that are blacklisted by all administrators. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API for retrieving the list of whitelisted Bluetooth UUIDs for all administrators.
null
.SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability between devices during communication. An administrator can use this API to get the list of whitelisted UUIDs. Connections with matching devices are allowed. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to get active state of the Bluetooth device restriction.
true
if enabled and false
otherwiseSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to check whether Bluetooth device restriction is active. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to check whether the Bluetooth log is enabled.
true
if enabled, false
if disabled.This policy supports multiple administrators. The policy is enabled when at least one administrator enables it. The policy is disabled when all administrators disable it. By default, this feature is disabled. |
API level 5 |
MDM 3.0 |
Global Scope |
Deprecated in API level 36
API to get the activity state of Bluetooth UUID restrictions.
true
if enabled, else false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability between devices during communication. An administrator can check whether Bluetooth UUID restriction is active. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API to get caller Id display status on a connected Bluetooth device.
true
if caller id display is allowed on connected Bluetooth device
during incoming call, else false
.An administrator can use this API to determine whether caller Id display is allowed on
a connected Bluetooth device during an incoming call.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { if (bluetoothPolicy.isCallerIDDisplayAllowed()) { Log.d(TAG, "caller Id display allowed on call "); } else { Log.w(TAG, "caller Id display not allowed on call"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
API level 6 |
MDM 4.0 |
Global Scope |
Deprecated in API level 35
API to check whether the connection via Bluetooth to a desktop or laptop is enabled.
true
if enabled, false
if disabledAn administrator can use this API to check whether the connection via Bluetooth to a
desktop or laptop is enabled. By default, this API returns true . |
API level 2 |
MDM 2.0 |
Global Scope |
API to check whether discoverable mode is enabled.
true
if enabled, false
if disabledAn administrator can use this API to check whether discoverable mode is enabled. By
default, this API returns true . |
API level 2 |
MDM 2.0 |
Global Scope |
API to check whether limited discoverable mode is enabled.
true
if limited discoverable mode is enabled, false
if
limited discoverable mode is disabledAn administrator can use this API to check whether limited discoverable mode is
enabled. If limited discoverable mode is disabled, Bluetooth is always in discoverable mode
when turned on. By default, this API returns true , and device is in limited
discoverable mode (i.e., device can be discovered by other devices for a limited period of
time). The default duration value is 120 seconds. |
API level 2 |
MDM 2.0 |
Global Scope |
API to check whether outgoing calls are allowed via a Bluetooth headset.
true
if outgoing calls are allowed, false
if outgoing calls
are not allowedAn administrator can use this API to check whether outgoing calls are enabled via a
Bluetooth headset. By default, this API returns true . |
API level 2 |
MDM 2.0 |
Global Scope |
API to check whether Bluetooth pairing is enabled.
true
if Bluetooth pairing is enabled, false
if Bluetooth
pairing is disabledAn administrator can use this API to check whether Bluetooth pairing is enabled. By
default, this API returns true . |
API level 2 |
MDM 2.0 |
Global Scope |
API to check whether a specific Bluetooth profile is enabled.
profile | profile setting configuration needed. See BluetoothPolicy.BluetoothProfile |
---|
true
if enabled, false
if disabledAn administrator can use this API to check whether a specific Bluetooth profile is
enabled. By default, this API returns true . |
API level 2 |
MDM 2.0 |
Global Scope |
API for removing a device from the Bluetooth device blacklist.
devices | Bluetooth device to be removed from blacklist |
---|
true
if the device was successfully removed from the blacklist, else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove a Bluetooth device from the blacklist.
Connections with matching devices are then allowed. The blacklist takes effect only after
being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); //device to be removed from black list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
API for removing a device from the Bluetooth device whitelist.
devices | Bluetooth device to be removed from whitelist |
---|
true
if the device was successfully removed from the whitelist else
false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove a Bluetooth device from the whitelist. The
whitelist takes effect only after being activated using
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); //device to be removed from white list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to remove UUIDs from the Bluetooth UUID blacklist.
UUIDs | Bluetooth UUIDs to be removed from blacklist |
---|
true
if the UUID successfully removed from blacklist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability
between devices during communication. An administrator can use this API to remove Bluetooth
UUIDs from the blacklist after they were added by
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); // UUIDs to be removed from black list. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to remove specified UUIDs from Bluetooth UUID whitelist.
UUIDs | Bluetooth UUIDs to be removed from whitelist |
---|
true
if the UUID is successfully removed from the whitelist, else
false
SecurityException | If caller does not have required permissions |
---|
Bluetooth UUIDs represent features offered by devices and are used for interoperability between devices during communication. An administrator can use this API to remove Bluetooth UUIDs from the whitelist. Connections with matching UUID are allowed. If the same UUID is present in the whitelist and blacklist and was added by the same administrator, the whitelist takes preference. The whitelist takes effect only after being activated using activateBluetoothUUIDRestriction.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); // UUID to be removed from whitelist. List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 36
API to allow or disallow file sharing via Bluetooth.
enable | true to allow file sharing via Bluetooth, false to
disallow file sharing via Bluetooth |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to block any kind of file sharing via Bluetooth,
either sending or receiving a file.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.setAllowBluetoothDataTransfer(false); if (true == result) { // any file sharing through Bluetooth fails } else { // policy is not applied and previous state prevails } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to enable or disable the Bluetooth log feature.
enable | true to enable, false to disable |
---|
true
if bluetooth log was successfully enabled/disabled, else
false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to log all Bluetooth connections, which includes the
profile used, the IDs of the paired devices, the name and path of files exchanged, and the
time that the user enabled discovery mode. The log size is limited to 1000 entries (the
newest entries rewrite the oldest entries). The log is automatically cleared when this policy
is disabled. The administrator can use getBluetoothLog() to get the Bluetooth log
stored on the device.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.setBluetoothLogEnabled(true); if (true == result) { // log is enabled } else { // log is not enabled } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 5 |
MDM 3.0 |
Global Scope |
Deprecated in API level 35
API to enable or disable desktop or laptop connection via Bluetooth
enable | true to enable, false to disable |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to block Bluetooth connection with a desktop or
laptop. The API blocks device pairing with any kind of Bluetooth devices falling into the
category of desktop or laptop.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.setDesktopConnectivityState(false); if (true == result) { // administered device cannot be connected to any Bluetooth devices falling into // the desktop or laptop category } else { // default behaviour - can be connected to other Bluetooth devices // in a computer category if not overridden previously // with any other value. } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to enable or disable Bluetooth discoverable mode.
enable | true to enable, false to disable |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to silently enable or disable Bluetooth discoverable
mode. When disabled, the Bluetooth device can never be set in discoverable mode.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.setDiscoverableState(false); if (true == result) { // administered device cannot be discovered with any Bluetooth devices } else { // default behaviour - can be discovered by other Bluetooth devices // if not overridden previously with any other value. } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to enable or disable limited discoverable mode.
enable | true to enable, false to disable |
---|
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to silently enable or disable limited discoverable
mode. If limited discoverable mode is disabled, Bluetooth is always be in discoverable mode
when turned on. By default, the device is in limited discoverable mode (i.e., device can be
discovered by other devices for limited period of time). The default duration value is 120
seconds.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.setLimitedDiscoverableState(false); if (true == result) { // administered device can be always discovered. } else { // default behaviour - discoverable for 120 second if not overridden // previously with any other value. } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to enable or disable Bluetooth pairing with other Bluetooth devices.
enable | true to enable, false to disable |
---|
true
on success, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to block pairing with any kind of Bluetooth devices,
although devices can still be discovered. Any devices already paired will continue with same
pairing state and if it is unpaired by user then user cannot pair it again.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { boolean result = bluetoothPolicy.setPairingState(false); if (true == result) { // administrator device cannot be paired with any other Bluetooth devices. } else { // default behavior - can be paired with other Bluetooth devices, if not overridden // previously } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
API to enable or disable a specific Bluetooth profile. For specific profiles, see
BluetoothPolicy.BluetoothProfile
.
enable | true to enable, false to disable |
---|---|
profile | Profile setting to be configured |
true
if successful, else false
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to silently enable or disable a specific Bluetooth
profile. Example :BluetoothProfile.BLUETOOTH_HSP_PROFILE BluetoothProfile.BLUETOOTH_HFP_PROFILE BluetoothProfile.BLUETOOTH_A2DP_PROFILE
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); BluetoothPolicy bluetoothPolicy = edm.getBluetoothPolicy(); try { // Block Bluetooth headset devices boolean result = bluetoothPolicy.setProfileState(false, BluetoothProfile.BLUETOOTH_HSP_PROFILE); if (true == result) { // administered device cannot be paired with any Bluetooth headset // devices } else { // default behaviour - can be paired with Bluetooth headset devices // if not overridden previously with any other value. } // Block Bluetooth hands-free devices connection result = bluetoothPolicy.setProfileState(false, BluetoothProfile.BLUETOOTH_HFP_PROFILE); if (true == result) { // administered device cannot be paired with any Bluetooth hands-free // devices } else { // default behaviour - can be paired with Bluetooth handsfree devices // if not overridden previously with any other value. } // Block Bluetooth A2DP supported devices connection result = bluetoothPolicy.setProfileState(false, BluetoothProfile.BLUETOOTH_A2DP_PROFILE); if (true == result) { // administered device cannot be paired with any Bluetooth a2dp // devices } else { // default behavior - can be paired with Bluetooth a2dp devices // if not overridden previously with any other value. } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_BLUETOOTH" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |