java.lang.Object | |
↳ | com.samsung.android.knox.net.wifi.WifiPolicy |
This class provides APIs to configure Wi-Fi related settings and manage Wi-Fi profiles.
API level 2 |
MDM 2.0 |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SECURITY_LEVEL_EAP_AKA | EAP-AKA Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_AKA_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_AKA_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_AKA_PRIME | EAP-AKA' Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_AKA_PRIME_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_AKA_PRIME_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_FAST | Deprecated in API level 30 | |||||||||
int | SECURITY_LEVEL_EAP_FAST_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_FAST_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_LEAP | Deprecated in API level 30 | |||||||||
int | SECURITY_LEVEL_EAP_LEAP_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_LEAP_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_PEAP | EAP-PEAP Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_PEAP_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_PEAP_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_PWD | EAP-PWD Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_PWD_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_PWD_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_SIM | EAP-SIM Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_SIM_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_SIM_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_TLS | EAP-TLS Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_TLS_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_TLS_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_TTLS | EAP-TTLS Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_EAP_TTLS_CCKM | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_EAP_TTLS_FT | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_FT_PSK | Deprecated in API level 29 | |||||||||
int | SECURITY_LEVEL_OPEN | Open Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_SAE | SAE (WPA3 personal) Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_WEP | WEP Wi-Fi security level. | |||||||||
int | SECURITY_LEVEL_WPA | WPA/WPA2-PSK Wi-Fi security level. | |||||||||
String | SECURITY_TYPE_OPEN | Open security type. | |||||||||
String | SECURITY_TYPE_SAE | SAE security type. | |||||||||
String | SECURITY_TYPE_WPA2_PSK | WPA2 PSK security type. | |||||||||
String | SECURITY_TYPE_WPA_PSK | Deprecated in API level 27 |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 13. | |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 28
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
NOTE: This API is not available since Android 13. | |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 28
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
| |||||||||||
Deprecated
in API level 35
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
EAP-AKA Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-AKA-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-AKA-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
EAP-AKA' Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-AKA'-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-AKA'-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 30
EAP-FAST Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
Deprecated in API level 29
EAP-FAST-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-FAST-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 30
EAP-LEAP Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
Deprecated in API level 29
EAP-LEAP-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-LEAP-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
EAP-PEAP Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
Deprecated in API level 29
EAP-PEAP-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
Deprecated in API level 29
EAP-PEAP-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
EAP-PWD Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-PWD-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-PWD-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
EAP-SIM Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-SIM-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
Deprecated in API level 29
EAP-SIM-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 17 |
MDM 5.5 |
EAP-TLS Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
Deprecated in API level 29
EAP-TLS-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
Deprecated in API level 29
EAP-TLS-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
EAP-TTLS Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
Deprecated in API level 29
EAP-TTLS-CCKM Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
Deprecated in API level 29
EAP-TTLS-FT Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
Deprecated in API level 29
FT-PSK Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 15 |
MDM 5.4 |
Open Wi-Fi security level. Flag used to set the minimum security level allowed to establish a
Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
SAE (WPA3 personal) Wi-Fi security level. Flag used to set the minimum security level allowed to establish a Wi-Fi connection on the device.
API level 35 |
KNOX 3.8 |
WEP Wi-Fi security level. Flag used to set the minimum security level allowed to establish a
Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
WPA/WPA2-PSK Wi-Fi security level. Flag used to set the minimum security level allowed to
establish a Wi-Fi connection on the device. Used for setMinimumRequiredSecurity(int)
.
API level 2 |
MDM 2.0 |
Open security type. Used to configure a Wi-Fi AP configuration. Used for
setWifiApSetting(String, String, String)
.
API level 4 |
MDM 2.2 |
SAE security type. Used to configure a Wifi AP Configuration. Used for
setWifiApSetting(String, String, String)
API level 35 |
KNOX 3.8 |
WPA2 PSK security type. Used to configure a Wifi AP Configuration. Used for
setWifiApSetting(String, String, String)
API level 27 |
KNOX 3.2.1 |
Deprecated in API level 27
WPA PSK security type. Used to configure a Wi-Fi AP configuration. Used for
setWifiApSetting(String, String, String)
.
API level 4 |
MDM 2.2 |
Deprecated in API level 35
API to activate or deactivate access restriction based on the Wi-Fi network service set identifier (SSID).
activate | true to activate the Wi-Fi network access policy,
false to deactivate the Wi-Fi network access policy |
---|
true
on successful activation or deactivation of access policy, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to activate the SSID-based Wi-Fi network blacklist and
whitelist policies. The SSID-based Wi-Fi network whitelist and blacklist policies are not
applied until activated using this API.
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 13.
API to add a service set identifier (SSID) to the list of blocked networks.
ssid | The SSID to block |
---|
true
if adding blocked network was successful, else false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to add an SSID to the list of blocked networks,
which prevents the user from connecting to it. The blocked network still appears in the
Access Point list but is disabled. If the to-be-blocked network is connected when the SSID is
added, the user is disconnected. A network is considered blocked if any administrator has it
in its blacklist.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getWifiPolicy().addBlockedNetwork("Other Company Wi-Fi"); if (success) { Log.d(TAG, "Adding blocked network succeeded"); } else { Log.d(TAG, "Adding blocked network failed"); } } 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_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to add Wi-Fi network service set identifiers (SSIDs) to the Wi-Fi network blacklist.
ssid | Wi-Fi network SSID list to be added to blacklist |
---|
true
if the SSID is successfully added in to blacklist, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to blacklist Wi-Fi networks based on the Wi-Fi
network SSID. The device does not connect to Wi-Fi networks with matching SSIDs. The
blacklisted Wi-Fi networks still appear in the AP list but are disabled, and the user cannot
access them. If the network is connected when the SSID is added to the blacklist, the user is
disconnected. For a device managed by multiple administrators, a network is considered
blacklisted if at least one administrator has the SSID in the blacklist. The character '*' is
the only wild card is allowed in the blacklist specification, which disables connection to
all Wi-Fi networks except those specified in the whitelist.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blackList = new ArrayList<String>(); blackList.add("Starbucks3462"); blackList.add("Android8480"); boolean success = edm.getWifiPolicy().addWifiSsidsToBlackList(blackList); if (success) { Log.d(TAG, "Addition to blacklist succeeded"); edm.getWifiPolicy().activateWifiSsidsRestriction(true); } else { Log.d(TAG, "Addition to blacklist failed"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); }If the same administrator adds a Wi-Fi network to the Wi-Fi network whitelist using addWifiSsidsToWhiteList(List) as well as the blacklist, the user can still connect
to that Wi-Fi network. The whitelist is the exception to the blacklist. If the SSID of a
Wi-Fi network currently being connected matches an SSID in both the blacklist and the
whitelist of the same administrator, the whitelist takes priority over the blacklist, and the
user is allowed to connect to that Wi-Fi network.
After configuring the blacklist, make sure the policy is activated using isWifiSsidRestrictionActive() ; if not activated, use
activateWifiSsidRestriction(boolean) to activate the blacklist. Unless this step is
performed, the blacklist policy is not activated.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to add a list of wifi network SSIDs to the wifi network whitelist and default blacklist all other wifi network SSIDs.
ssid | wifi network SSID list to be added to whitelist |
---|---|
defaultBlackList | true to default blacklist all Wifi network SSIDs,
false to keep the blacklist unchanged |
true
if the SSID is successfully added in to whitelist and "*" is
successfully added in to blacklist if needed, else false
on failure of eitherSecurityException | If caller does not have required permissions |
---|
Administrator can use this API to whitelist wifi networks based on the SSID of those
wifi networks. The wifi networks with matching SSIDs will be excepted from the blacklist and
will be allowed to connect to the device. Also, rest all other wifi network SSIDs could be
default blaklisted using this API. If defaultBlackList parameter is set to true ,
"*" will be added in blacklist.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
try {
boolean defaultBlackList = true;
This whitelist is an exception to the blacklist which is created using
addWifiSsidsToBlackList(List) . If the SSID of the wifi network matches the SSID in
both the blacklist and whitelist of the same admin, the whitelist being an exception to the
blacklist will take priority and the wifi network will be allowed to connect.
After configuring the whitelist make sure the policy is activated using isWifiSsidRestrictionActive() if not activated, use
activateWifiSsidRestriction(boolean) to activate the whitelist. Unless this is done
whitelist policy will not be activated.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
Global Scope |
Deprecated in API level 35
API to add a Wi-Fi network service set identifier (SSID) to the Wi-Fi network whitelist.
ssid | The Wi-Fi network SSID(s) to be added to the whitelist |
---|
true
if the SSID is successfully added to whitelist, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to add a Wi-Fi network service set identifier (SSID)
to Wi-Fi network whitelist. A Wi-Fi network with a matching SSIDs is excepted from the
blacklist, and the device can connect to the whitelisted Wi-Fi network.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> whiteList = new ArrayList<String>(); whiteList.add("Starbucks3462"); whiteList.add("Android8480"); boolean success = edm.getWifiPolicy().addWifiSsidsToWhiteList(whiteList); if (success) { Log.d(TAG, "Addition to whitelist succeeded"); edm.getWifiPolicy().activateWifiSsidsRestriction(true); } else { Log.d(TAG, "Addition to whitelist failed"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); }The whitelist is an exception to the blacklist that is created using addWifiSsidsToBlackList(List) . If the SSID of the Wi-Fi network matches the SSID in
both the blacklist and whitelist of the same administrator, the whitelist takes priority as
an exception to the blacklist, and the device is allowed to connect to the Wi-Fi network.
After configuring the whitelist, make sure the policy is activated using isWifiSsidRestrictionActive() ; if not activated, use
activateWifiSsidRestriction(boolean) to activate the whitelist. Unless this step is
performed, the whitelist policy is not activated.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to allow or deny user to start an open (non-secured) Wi-Fi hotspot.
allow | false to deny user from starting an open Wi-Fi hotspot.
true to allow user to start an open Wi-Fi hotspot. |
---|
true
if policy is applied successfully, false
on failure.SecurityException | If caller does not have required permissions |
---|
An open Wi-Fi hotspot is a Wi-Fi connection with no security constraints that allows any Wi-Fi-capable device to connect. When disabled, the user cannot start an open Wi-Fi hotpot. When enabled back, the user is allowed to start an open Wi-Fi hotspot. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
Global Scope |
Deprecated in API level 35
API to allow or deny the user to edit Wi-Fi AP settings.
allow | false to deny user changing Wi-Fi AP settings. true to
allow user to change Wi-Fi AP settings. |
---|
true
if policy is applied successfully, false
on failure.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to deny the user modifying Wi-Fi AP settings. When disabled, the UI is grayed out so the user cannot modify the settings. When enabled, the user can modify the Wi-Fi AP Settings. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to remove all Wi-Fi network service set identifiers (SSIDs) from the Wi-Fi network blacklist.
true
if all SSIDs are successfully removed from the blacklist, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all Wi-Fi network SSIDs from blacklist.
Even though the SSIDs are removed from the blacklist, the user must enable the networks
manually from the Settings application to make a connection.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getWifiPolicy().clearWifiSsidsFromBlackList(); if (success) { Log.d(TAG, "Clearing blacklist succeeded"); } else { Log.d(TAG, "Clearing blacklist failed"); } } 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_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to remove all wifi network SSIDs from the wifi network whitelist and blacklist
true
if all SSIDs is successfully removed from blacklist and whitelist
else false
on failureSecurityException | If caller does not have required permissions |
---|
Administrator can use this API to remove all wifi network SSIDs from blacklist and
whitelist. Even though SSIDs will be removed form whitelist and blacklist, the user will have
to enable it manually from Settings Application, to make a connection.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getWifiPolicy().clearWifiSsidBlackList(); if (success) { Log.d(TAG, "Clearing blacklist and whitelist is a Success"); } else { Log.d(TAG, "Clearing blacklist or whitelist is a Failure"); } } 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_WIFI" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
Global Scope |
Deprecated in API level 35
API to remove all Wi-Fi network service set identifiers (SSIDs) from the Wi-Fi network whitelist.
true
if all SSIDs are successfully removed from whitelist, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all Wi-Fi network SSIDs from the Wi-Fi
network whitelist. If an SSID is removed from the whitelist and the same SSID occurs in the
Wi-Fi network blacklist, the connection to that Wi-Fi network is blocked.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getWifiPolicy().clearWifiSsidsFromWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist succeeded"); } else { Log.d(TAG, "Clearing whitelist failed"); } } 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_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to check if the user is allowed to modify certain Wi-Fi network settings.
true
if allowed to change all Wi-Fi network settings, false
if one or more administrators enables restriction.An administrator can use this API to check whether or not the user is allowed to
modify Wi-Fi enterprise settings. For a device managed by multiple administrators, the user
is restricted in modifying Wi-Fi settings if at least one administrator has set the value to
false .
|
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to check whether the user is allowed to add Wi-Fi networks on the device.
showMsg | To inform the user about MDM restriction. |
---|
true
if allowed to add Wi-Fi network configuration, false
if any administrator denies additions.An administrator can use this API to check whether the user is allowed to add a new Wi-Fi network configuration. Mobile device management (MDM) clients can still create profiles even if user profiles are denied. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean allowUserProfiles = edm.getWifiPolicy().getAllowUserProfiles(false); if (allowUserProfiles == true) { Log.d(TAG, "Allowed to add Wi-Fi network settings"); } else { Log.d(TAG, "Not allowed to add Wi-Fi network settings"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
// When you create container successfully, containerID will be returned via intent. // Use this containerID in below API. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); KnoxContainerManager kcm = ekm.getKnoxContainerManager(containerID); try { boolean allowUserProfiles = kcm.getWifiPolicy().getAllowUserProfiles(false); if (allowUserProfiles == true) { Log.d(TAG, "Allowed to add Wi-Fi network settings"); } else { Log.d(TAG, "Not allowed to add Wi-Fi network settings"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
API level 2 |
MDM 2.0 |
User Scope |
Deprecated in API level 35
API to check whether the user is allowed to connect automatically to a known Wi-Fi network.
true
if user is allowed to connect automatically to a Wi-Fi access
point, false
if user is not allowed to connect automatically.An administrator can use this API to check whether the user is allowed to connect automatically to a known Wi-Fi network and take appropriate action based on enterprise policy. |
API level 6 |
MDM 4.0 |
Global Scope |
Deprecated in API level 33
API to get the list of blocked network service set identifiers (SSIDs).
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get the list of blocked Wi-Fi network SSIDs from
all administrators. An SSID in the list identifies a network that remains disabled, and the
user cannot connect to it.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blockedNetworks = edm.getWifiPolicy().getBlockedNetworks(); for (String ssid : blockedNetworks) { Log.d(TAG, "blocked network: " + ssid); } } 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_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to get the current minimum security level required to connect to a Wi-Fi network.
An administrator can use this API to get the current minimum security level to connect
to a Wi-Fi network. The possible return values are grouped with the following security levels
(shown from lowest to highest security level):
1) OPEN |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to get a list of all enterprise WLAN service set identifiers (SSIDs) configured on the device.
null
on failure.SecurityException | If caller does not have required permissions |
---|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to get the status of the password (hidden or visible) for the Wi-Fi network edit dialog.
true
if password is hidden, false
if the password is
visible.API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 28
API to get whether the device prompts the user to re-enter credentials if WPA/WPA2-PSK authentication fails.
true
if the device shows the prompt, false
if the device
does not show the prompt.API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to get the current Wi-Fi AP, tethering or hotspot setting of the device.
null
if no setting is currently
applied. Only the following fields are provided for a Wi-Fi AP setting:
WifiConfiguration.SSID, WifiConfiguration.allowedKeyManagement. All other fields are either 0 or
null
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to retrieve the current Wi-Fi AP settings on the
device. The Wi-Fi AP uses these settings if it is already active.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { WifiConfiguration config = edm.getWifiPolicy().getWifiApSetting(); if (config != null) { Log.d(TAG, "SSID : " + wc.SSID + " Security Type : " + wc.allowedKeyManagement); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } // Sample Output // SSID : Android7346 Security Type : OPEN |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to get a complete Wi-Fi profile created or edited by an administrator.
ssid | The service set identifier (SSID) of the profile to be found. |
---|
null
if no Wi-Fi profile is set.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to get a WifiAdminProfile object previously
created or edited, which represents an enterprise Wi-Fi network.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { WifiAdminProfile wifiProfile = edm.getWifiPolicy().getWifiProfile("Company Wi-Fi"); if (wifiProfile != null) { Log.d(TAG, "Wi-Fi ssid = " + wifiProfile.ssid + " security = " + wifiProfile.security); } else { Log.d(TAG, "Getting Wi-fi profile failed"); } } 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_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
The provided SSID must refer to a network created through
setWifiProfile(WifiAdminProfile) . |
Global Scope |
Deprecated in API level 35
API to retrieve the list of blacklisted Wi-Fi network service set identifiers (SSIDs) for all administrators.
null
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to retrieve the list of all blacklisted Wi-Fi network
SSIDs. The device cannot connect to Wi-Fi networks with matching SSIDs.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); List<WifiControlInfo> wifiList = edm.getWifiPolicy().getWifiSsidsFromBlackLists(); for (List controlInfo : wifiList) { Log.d(TAG, "Administrator : " + controlInfo.adminPackageName + " Entries : " + controlInfo.entries); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to retrieve a list of whitelisted Wi-Fi network service set identifiers (SSIDs) for all administrators.
WifiControlInfo
List of whitelisted SSIDs along with the controlling administrator
package name if it succeeds, else return null
SecurityException | If caller does not have required permissions |
---|
An administrators can use this API to retrieve a list of whitelisted Wi-Fi network SSIDs.
Wi-Fi networks with a matching SSID are excepted from the blacklist, and the device can
connect to these networks.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); List<WifiControlInfo> wifiList = edm.getWifiPolicy().getWifiSsidsFromWhiteLists(); for (List controlInfo : wifiList) { Log.d(TAG, "Administrator : " + controlInfo.adminPackageName + " Entries : " + controlInfo.entries); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated
in API level 35
NOTE: This API is not available since Android 13.
API to check whether a network with a given service set identifier (SSID) is blocked.
ssid | The SSID of the network to verify. |
---|---|
showMsg | To display information if network is blocked. |
true
if the network is blocked, false
if the network is not
blocked.API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to check whether the user is allowed to start an open Wi-Fi hotspot
true
if open hotspot is allowed, false
if denied.An administrator can use this API to check whether the user is allowed to start an
open Wi-Fi hotspot.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean allowOpenWifi = edm.getWifiPolicy().isOpenWifiApAllowed(); if (allowOpenWifi) { Log.d(TAG, "Open Wifi AP is allowed settings"); } else { Log.d(TAG, "Open Wifi AP not allowed settings"); } } 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 user is allowed to modify the Wi-Fi access point (AP) setting.
true
if modification is allowed, false
if modification is
denied.An administrator can use this API to check whether the user is allowed to modify the
hotspot settings. If modification is denied, the UI is grayed out so the user cannot modify
the settings. If modification is allowed, the UI is accessible and the user can modify the
Wi-Fi AP settings.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean allowUserModify = edm.getWifiPolicy().isWifiApSettingUserModificationAllowed(); if (allowUserModify) { Log.d(TAG, "Allowed to modify Wi-Fi AP settings"); } else { Log.d(TAG, "Not allowed to modify Wi-Fi AP settings"); } } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to retrieve the activation state of the Wi-Fi network service set identifier (SSID) whitelist and blacklist policies.
true
if policy is activated or false
if policy is
deactivatedSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to check whether the SSID-based Wi-Fi network blacklist and
whitelist policy is activated for an administrator. The SSID-based Wi-Fi network whitelist
and blacklist policies are not applied unless activated using
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to check whether the user is allowed to change the Wi-Fi state.
true
if the user is allowed to change the Wi-Fi state, else
false
.API level 5 |
MDM 3.0 |
Global Scope |
Deprecated in API level 33
API to remove a service set identifier (SSID) from the list of blocked networks.
ssid | The SSID to unblock |
---|
true
if removing blocked network was successful, else false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove an SSID from the list of blocked networks, which allows the user to connect to it. For a device managed by multiple administrators, the SSID is unblocked and enabled again only if all administrators have removed the SSID from their blacklist. If any other administrator still has the SSID in its blacklist, the network remains blocked. |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to remove the enterprise WLAN configuration.
ssid | The service set identifier (SSID) of the enterprise WLAN network to be deleted. |
---|
true
if removal was successful, else false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove an enterprise WLAN configuration. The
network name is removed from the access point list so that the user does not need to remove
it manually.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); WifiPolicy wifiPolicy = edm.getWifiPolicy(); try { List<String> networks = wifiPolicy.getNetworkSSIDList(); if (networks.contains("Company Wi-Fi")) { boolean success = wifiPolicy.removeNetworkConfiguration("Company Wi-Fi"); if (success) { Log.d(TAG, "Removing configuration succeeded"); } else { Log.d(TAG, "Removing configuration failed"); } } else { Log.d(TAG, "Wi-Fi network does not exist"); } } 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_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
The provided SSID must refer to a network created through
setWifiProfile(WifiAdminProfile) |
Global Scope |
Deprecated in API level 35
API to remove Wi-Fi network service set identifiers (SSIDs) from the Wi-Fi network blacklist.
ssid | Wi-Fi network SSID to be removed from blacklist |
---|
true
if the SSID is successfully removed from the blacklist, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove Wi-Fi network SSIDs from blacklist. The
Wi-Fi networks removed from blacklist with matching SSIDs are allowed to connect to the
device. Even though the SSIDs are removed from blacklist, the user must enable them manually
from Settings application to make a connection.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blackList = new ArrayList<String>(); blackList.add("Starbucks3462"); blackList.add("Android8480"); boolean success = edm.getWifiPolicy().removeWifiSsidsFromBlackList(blackList); if (success) { Log.d(TAG, "Removal from blacklist succeeded"); } else { Log.d(TAG, "Removal from blacklist failed"); } } 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_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to remove a Wi-Fi network service set identifier (SSID) from the Wi-Fi network whitelist.
ssid | Wi-Fi network SSID(s) to be removed from whitelist |
---|
true
if the SSID is successfully removed from the whitelist, else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove Wi-Fi network SSIDs from Wi-Fi network
whitelist. If a SSID is removed from the whitelist and the same SSID occurs in the Wi-Fi
network blacklist, the connection to that Wi-Fi network is blocked.
NOTE: From Knox 3.9 onwards, the following rules will apply: Allowlist - Only the SSIDs in the allowlist are allowed and all others are blocked. The blocklist doesn't have any effect. Blocklist - Only the SSIDs in the blocklist are blocked and all others are allowed. Blocklist only takes effect if the allowlist is empty.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> whiteList = new ArrayList<String>(); whiteList.add("Starbucks3462"); whiteList.add("Android8480"); boolean success = edm.getWifiPolicy().removeWifiSsidsFromWhiteList(whiteList); if (success) { Log.d(TAG, "Removal from whitelist succeeded"); } else { Log.d(TAG, "Removal from whitelist failed"); } } 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_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to allow or deny the user to modify some Wi-Fi settings of an enterprise network profile.
enable | true to allow changes in all Wi-Fi network settings,
false to allow changes only in username and/or password and block removing
enterprise network. |
---|
true
if the value was set correctly, false
on errors.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to allow or deny users to modify selected Wi-Fi
settings like static ip configuration, proxy settings, security type and others, of an
enterprise network profile. When this policy is in effect (value false ) the user
can modify only the username, anonymous identity, password and/or wep keys of a Wi-Fi
enterprise network. In addition, the user cannot remove the enterprise network. When
true , the user can modify all Wi-Fi network settings normally and also remove
it.
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to allow or deny the user to add Wi-Fi networks on the device.
enable | true to allow the user to add new profiles. |
---|
true
if successful, false
if failed.SecurityException | If caller does not have required permissions |
---|
When this policy is set to false , the user cannot add a new Wi-Fi network
through Settings or any other application. The only profiles allowed are enterprise profiles
set through mobile device management (MDM) clients. For a device managed by multiple
administrators, the user cannot add a Wi-Fi profile if at least one administrator disables
profile additions.
|
NOTE: Since MDM 5.4.1, only Android users (Owner/Guest user) administrator can call this
API. For container, API will return |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
User Scope |
Deprecated in API level 35
API to allow or disallow the user to connect automatically to a known Wi-Fi network.
enable | true to allow user to automatically connect to a Wi-Fi access
point. |
---|
true
if successful, false
if it failed.SecurityException | If caller does not have required permissions |
---|
When this policy is set to false , the user cannot automatically connect
to a known Wi-Fi access point that is already stored on the device. However, the user can
still connect to the Wi-Fi network manually through Wi-Fi settings.
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
Global Scope |
Deprecated in API level 35
API to set a minimum security level required to connect to a Wi-Fi network.
secType | The minimum required security. |
---|
true
if successful, false
on failure.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to set a minimum security level to connect to a
Wi-Fi network. The security types have been grouped into security levels. Any network with a
security type below the minimum security level set by the administrator is disabled and not
allowed to connect to Wi-Fi. For a device managed by multiple administrators, the value
belonging to the highest security level set takes precedence. The acceptable values are
grouped with the following security levels (shown from lowest to highest security level):
1) OPEN |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to set the hidden state of the password for the Wi-Fi network edit dialog.
passHidden | Whether the password hidden from the user. |
---|
true
if setting the password hidden characters is successful, else
false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to set whether the user can show the password
characters in the Wi-Fi Access Point dialog in the Settings application. The default value is
false , which means the characters are visible.
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 28
API to set whether the device prompts the user to re-enter credentials if WPA/WPA2-PSK authentication fails.
enable | To enable or deny the prompt for credentials. |
---|
true
if prompting for credentials is enabled successfully, else
false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to set whether the system prompts the user to
re-enter credentials on WPA/WPA2 networks, which return an authentication failed message. The
default value is true . WEP and EAP networks fail silently when a wrong
credential is submitted.
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_WIFI" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to configure the Wi-Fi access point (AP), tethering, or hotSpot setting of the device.
ssid | The service set identifier (SSID) of the Wi-Fi network to be broadcast to Wi-Fi
adapters. A null or empty string fails the API. A maximum of 32 characters is
allowed. |
---|---|
securityType | Security type of the Wi-Fi AP. Should be one of
SECURITY_TYPE_OPEN , SECURITY_TYPE_WPA2_PSK or SECURITY_TYPE_SAE .
Any other type fails the API.
NOTE: The security type SECURITY_TYPE_WPA_PSK is deprecated since Knox 3.2.1.
|
password | Password to be used when security type is either SECURITY_TYPE_WPA2_PSK
or SECURITY_TYPE_SAE ;
ignored for SECURITY_TYPE_OPEN security type. A minimum of eight characters is
required for both security types: SECURITY_TYPE_WPA2_PSK and SECURITY_TYPE_SAE . |
true
if hot spot was configured successfully, false
on
failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to configure the Wi-Fi AP setting on the device so
that the next time the user activates the hotspot, it uses the given settings. If the Wi-Fi
AP is already active, the new setting is applied to the Wi-Fi AP immediately.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getWifiPolicy().setWifiApSetting("Android123", WifiPolicy.SECURITY_TYPE_OPEN, null); if (success) { Log.d(TAG, "Configuring network is a success"); } else { Log.d(TAG, "Configuring network is a failure"); } } 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_WIFI" permission which has a protection level of signature. |
API level 4 |
MDM 2.2 |
Global Scope |
Deprecated in API level 35
API to create or edit a complete Wi-Fi profile.
profile | The profile to be created or edited. |
---|
true
if creating or editing the profile was successful, else
false
.SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to create or edit a full Wi-Fi profile using
WifiAdminProfile instead of calling each API separately.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { WifiAdminProfile wifiProfile = new WifiAdminProfile(); wifiProfile.ssid = "Company Wi-Fi"; // Example for Open security level wifiProfile.security = "NONE"; // Configuration for WEP security level wifiProfile.security = "WEP"; wifiProfile.wepKeyId = 1; wifiProfile.wepKey1 = "abdce"; // Example for WPA/WPA2-PSK security level wifiProfile.security = "PSK"; wifiProfile.psk = "test1234"; // Example for EAP-PEAP security level wifiProfile.security = "EAP-PEAP"; wifiProfile.phase2 = "MSCHAPV2"; wifiProfile.userIdentity = "user@company.com"; wifiProfile.password = "sample_password"; // Create the network boolean success = edm.getWifiPolicy().setWifiProfile(wifiProfile); if (success) { Log.d(TAG, "Setting Wi-Fi profile succeeded"); } else { Log.d(TAG, "Setting Wi-Fi profile failed"); } } 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_WIFI" permission which has a protection level of
signature. From MDM 5.6 on, depending on the Credential Storage type identified by storageName parameter used in WifiAdminProfile(String) ,
a new permission will also be enforced. System Credential Storages will check for
'com.samsung.android.knox.permission.KNOX_UCM_ESE_MGMT' permission, while non-system onefs check
for 'com.samsung.android.knox.permission.KNOX_UCM_OTHER_MGMT' permission. Please refer to
Universal Credential Manager (UCM) DEV guide in order to have more details of how to get
these new permissions. |
API level 2 |
MDM 2.0 |
Global Scope |
Deprecated in API level 35
API to allow or disallow the user to change the Wi-Fi state.
allow | true to allow, else false |
---|
true
if successful, false
if failedSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to allow or disallow the user to change the Wi-Fi
state. If the administrator sets the value to allow, the user has UI access to change the
Wi-Fi state. If the value is set to disallow, the user does not have UI access to change the
state.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); WifiPolicy wifiPolicy = edm.getWifiPolicy(); try { boolean allowWifiStateChange = true; wifiPolicy.setWifiStateChangeAllowed(allowWifiStateChange); } catch (SecurityException e) { Log.w(TAG, "SecurityException: " + e); } |
The use of this API requires the caller to add the "com.samsung.android.knox.permission.KNOX_WIFI" permission with a protection level of signature. |
API level 5 |
MDM 3.0 |
Global Scope |