java.lang.Object | |
↳ | com.samsung.android.knox.accounts.DeviceAccountPolicy |
This class provides APIs to control device accounts such as those supported by the native e-mail application and Google accounts.
API level 6 |
MDM 4.0 |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
API to add a list of accounts of a specific account type to the account
addition blacklist.
| |||||||||||
API to add a list of accounts of a specific account type to the account
addition whitelist and default blacklist all other accounts of that specific
account type
| |||||||||||
API to add a list of accounts of a specific account type to the account
addition whitelist.
| |||||||||||
API to add a list of accounts of a specific account type to the account
removal blacklist.
| |||||||||||
API to add a list of accounts of a specific account type to the account
removal whitelist.
| |||||||||||
API to add a list of accounts of a specific account type to the account
removal whitelist and default blacklist all other accounts of that specific
account type
| |||||||||||
API to remove all accounts of a specific account type that are
blacklisted for addition.
| |||||||||||
API to remove all accounts of a specific account type from the account
addition whitelist and blacklist.
| |||||||||||
API to remove all accounts of a specific account type from the account
addition whitelist.
| |||||||||||
API to remove all accounts of a specific account type that are
blacklisted for removal.
| |||||||||||
API to remove all accounts of a specific account type from the account
removal whitelist and blacklist.
| |||||||||||
API to remove all accounts of a specific account type from the account
removal whitelist.
| |||||||||||
API to retrieve the list of accounts of a specific account type that are
blacklisted for addition by all administrators.
| |||||||||||
API to retrieve the addition whitelist across all administrators for
accounts of a specific account type.
| |||||||||||
API to retrieve the list of accounts of a specific account type that are
blacklisted for removal by all administrators.
| |||||||||||
API to retrieve the removal whitelist across all administrators for
accounts of a specific account type.
| |||||||||||
API to get a list of supported account types.
| |||||||||||
API to remove all device accounts of a particular type.
| |||||||||||
API to remove a list of accounts from the account addition blacklist of a
specific account type.
| |||||||||||
API to remove a list of accounts of a specific account type from the
account addition whitelist.
| |||||||||||
API to remove a list of accounts from the account removal blacklist of a
specific account type.
| |||||||||||
API to remove a list of accounts of a specific account type from the
account removal whitelist.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
API to add a list of accounts of a specific account type to the account addition blacklist.
type | account type |
---|---|
accounts | accounts list to be added to blacklist |
true
if the accounts is successfully added to blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to blacklist accounts based on the type of account. A user cannot add blacklisted accounts. An account is considered blacklisted if any administrator has the account in the blacklist. The whitelist is the exception to the blacklist. If the account name matches the pattern in both the blacklist and whitelist, the whitelist takes priority. During specification, Wildcard characters (for example, ".*@test.com") are allowed. Wildcard character is a character that may be substituted for any of a defined subset of all possible characters. The asterisk character ("*") substitutes for any zero or more characters, and the question mark ("?") substitutes for any one character or less but not more than the amount of question marks. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().addAccountsToAdditionBlackList("com.google", blackList); if (success) { Log.d(TAG, "Addition to blacklist is a success"); } else { Log.d(TAG, "Addition to blacklist is a failure"); } } 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 { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().addAccountsToAdditionBlackList("com.google", blackList); if (success) { Log.d(TAG, "Addition to blacklist is a success"); } else { Log.d(TAG, "Addition to blacklist 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to add a list of accounts of a specific account type to the account addition whitelist and default blacklist all other accounts of that specific account type
type | account type |
---|---|
accounts | accounts list to be added to whiteList |
defaultBlackList | true to default blacklist all other accounts of a specific
account type, false to keep the blacklist unchanged |
true
if the account is successfully added in to whiteList and "*@*.*"
into the black list if needed, else false
on failure of eitherSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to whitelist accounts based on the account type. A user can remove whitelisted accounts. Also, An administrator can use this API to blacklist all other accounts based on the account type by allowing "*@*.*" in the blaclist. account is considered whitelisted if any administrator has the account in their whitelist and no other administrators have the account in their blacklist. The whitelist is the exception to the blacklist. If the account name matches the pattern in both the blacklist and whitelist, the whitelist takes priority. Wildcard characters (for example, ".*@test.com") are allowed. Wildcard character is a character that may be substituted for any of a defined subset of all possible characters. The asterisk character ("*") substitutes for any zero or more characters, and the question mark ("?") substitutes for any one character or less but not more than the amount of question marks. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean defaultBlackList = true; List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().addAccountsToAdditionWhiteList("com.google", whiteList, defaultBlackList); if (success) { Log.d(TAG, "Addition to whiteList and blackList has succeeded"); } else { Log.d(TAG, "Addition to whiteList or blacklist has failed"); } } 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 defaultBlackList = true; List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().addAccountsToAdditionWhiteList("com.google", whiteList, defaultBlackList); if (success) { Log.d(TAG, "Addition to whiteList and blackList has succeeded"); } else { Log.d(TAG, "Addition to whiteList or blackList has 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_SECURITY" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
User Scope |
API to add a list of accounts of a specific account type to the account addition whitelist.
type | account type |
---|---|
accounts | accounts list to be added to whiteList |
true
if the account is successfully added in to whiteList else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to whitelist accounts based on the account type. A user can add whitelisted accounts. An account is considered whitelisted if any administrator has the account in their whitelist and no other administrators have the account in their blacklist. The whitelist is the exception to the blacklist. If the account name matches the pattern in both the blacklist and whitelist, the whitelist takes priority. . Wildcard characters (for example, ".*@test.com") are allowed. Wildcard character is a character that may be substituted for any of a defined subset of all possible characters. The asterisk character ("*") substitutes for any zero or more characters, and the question mark ("?") substitutes for any one character or less but not more than the amount of question marks. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().addAccountsToAdditionWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Addition to whiteList has succeeded"); } else { Log.d(TAG, "Addition to whiteList has failed"); } } 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 { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().addAccountsToAdditionWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Addition to whiteList has succeeded"); } else { Log.d(TAG, "Addition to whiteList has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to add a list of accounts of a specific account type to the account removal blacklist.
type | account type |
---|---|
accounts | accounts list to be added to blacklist |
true
if the accounts is successfully added to blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to blacklist accounts based on the type of account. A user cannot remove blacklisted accounts. A blacklisted account still appears in the accounts list in e-mail and settings applications but is disabled, and the user cannot select it. An account is considered blacklisted if any administrator has the account in the blacklist. The whitelist is the exception to the blacklist. If the account name matches the pattern in both the blacklist and whitelist, the whitelist takes priority. During specification, Wildcard characters (for example, ".*@test.com") are allowed. Wildcard character is a character that may be substituted for any of a defined subset of all possible characters. The asterisk character ("*") substitutes for any zero or more characters, and the question mark ("?") substitutes for any one character or less but not more than the amount of question marks. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().addAccountsToRemovalBlackList("com.google", blackList); if (success) { Log.d(TAG, "Addition to blacklist is a success"); } else { Log.d(TAG, "Addition to blacklist is a failure"); } } 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 { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().addAccountsToRemovalBlackList("com.google", blackList); if (success) { Log.d(TAG, "Addition to blacklist is a success"); } else { Log.d(TAG, "Addition to blacklist 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to add a list of accounts of a specific account type to the account removal whitelist.
type | account type |
---|---|
accounts | accounts list to be added to whiteList |
true
if the account is successfully added in to whiteList else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to whitelist accounts based on the account type. A user can remove whitelisted accounts. An account is considered whitelisted if any administrator has the account in their whitelist and no other administrators have the account in their blacklist. The whitelist is the exception to the blacklist. If the account name matches the pattern in both the blacklist and whitelist, the whitelist takes priority. . Wildcard characters (for example, ".*@test.com") are allowed. Wildcard character is a character that may be substituted for any of a defined subset of all possible characters. The asterisk character ("*") substitutes for any zero or more characters, and the question mark ("?") substitutes for any one character or less but not more than the amount of question marks. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().addAccountsToRemovalWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Addition to whiteList has succeeded"); } else { Log.d(TAG, "Addition to whiteList has failed"); } } 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 { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().addAccountsToRemovalWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Addition to whiteList has succeeded"); } else { Log.d(TAG, "Addition to whiteList has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to add a list of accounts of a specific account type to the account removal whitelist and default blacklist all other accounts of that specific account type
type | account type |
---|---|
accounts | accounts list to be added to whiteList |
defaultBlackList | true to default blacklist all other accounts of a specific
account type, false to keep the blacklist unchanged |
true
if the account is successfully added in to whiteList and "*@*.*"
into the black list if needed, else false
on failure of eitherSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to whitelist accounts based on the account type. A user can remove whitelisted accounts. Also, An administrator can use this API to blacklist all other accounts based on the account type by allowing "*@*.*" in the blaclist. account is considered whitelisted if any administrator has the account in their whitelist and no other administrators have the account in their blacklist. The whitelist is the exception to the blacklist. If the account name matches the pattern in both the blacklist and whitelist, the whitelist takes priority. Wildcard characters (for example, ".*@test.com") are allowed. Wildcard character is a character that may be substituted for any of a defined subset of all possible characters. The asterisk character ("*") substitutes for any zero or more characters, and the question mark ("?") substitutes for any one character or less but not more than the amount of question marks. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean defaultBlackList = true; List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().addAccountsToRemovalWhiteList("com.google", whiteList, defaultBlackList); if (success) { Log.d(TAG, "Addition to whiteList and blackList has succeeded"); } else { Log.d(TAG, "Addition to whiteList or blacklist has failed"); } } 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 defaultBlackList = true; List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().addAccountsToRemovalWhiteList("com.google", whiteList, defaultBlackList); if (success) { Log.d(TAG, "Addition to whiteList and blackList has succeeded"); } else { Log.d(TAG, "Addition to whiteList or blackList has 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_SECURITY" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
User Scope |
API to remove all accounts of a specific account type that are blacklisted for addition.
type | account type |
---|
true
if all accounts are successfully removed from blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all accounts of a specific account type from the account addition blacklist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getDeviceAccountPolicy().clearAccountsFromAdditionBlackList(); if (success) { Log.d(TAG, "Clearing blacklist has succeeded"); } else { Log.d(TAG, "Clearing blacklist has failed"); } } 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 success = kcm.getDeviceAccountPolicy().clearAccountsFromAdditionBlackList(); if (success) { Log.d(TAG, "Clearing blacklist has succeeded"); } else { Log.d(TAG, "Clearing blacklist has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove all accounts of a specific account type from the account addition whitelist and blacklist.
type | account type |
---|
true
if all accounts are successfully removed from whitelist and blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all accounts of a
specific account type from the account addition whitelist and blacklist.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getDeviceAccountPolicy().clearAccountsFromAdditionWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist and blacklist has succeeded"); } else { Log.d(TAG, "Clearing whitelist or whitelist has 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_SECURITY" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
User Scope |
API to remove all accounts of a specific account type from the account addition whitelist.
type | account type |
---|
true
if all accounts 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 accounts of a specific account type from the account addition whitelist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getDeviceAccountPolicy().clearAccountsFromAdditionWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist has succeeded"); } else { Log.d(TAG, "Clearing whitelist has failed"); } } 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 success = kcm.getDeviceAccountPolicy().clearAccountsFromAdditionWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist has succeeded"); } else { Log.d(TAG, "Clearing whitelist has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove all accounts of a specific account type that are blacklisted for removal.
type | account type |
---|
true
if all accounts are successfully removed from blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all accounts of a specific account type from the account removal blacklist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getDeviceAccountPolicy().clearAccountsFromRemovalBlackList(); if (success) { Log.d(TAG, "Clearing blacklist has succeeded"); } else { Log.d(TAG, "Clearing blacklist has failed"); } } 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 success = kcm.getDeviceAccountPolicy().clearAccountsFromRemovalBlackList(); if (success) { Log.d(TAG, "Clearing blacklist has succeeded"); } else { Log.d(TAG, "Clearing blacklist has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove all accounts of a specific account type from the account removal whitelist and blacklist.
type | account type |
---|
true
if all accounts are successfully removed from whitelist and blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove all accounts of a
specific account type from the account removal whitelist and blacklist.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getDeviceAccountPolicy().clearAccountsFromRemovalWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist and blacklist has succeeded"); } else { Log.d(TAG, "Clearing whitelist or whitelist has 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_SECURITY" permission which has a protection level of signature. |
API level 11 |
MDM 5.0 |
User Scope |
API to remove all accounts of a specific account type from the account removal whitelist.
type | account type |
---|
true
if all accounts 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 accounts of a specific account type from the account removal whitelist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { boolean success = edm.getDeviceAccountPolicy().clearAccountsFromRemovalWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist has succeeded"); } else { Log.d(TAG, "Clearing whitelist has failed"); } } 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 success = kcm.getDeviceAccountPolicy().clearAccountsFromRemovalWhiteList(); if (success) { Log.d(TAG, "Clearing whitelist has succeeded"); } else { Log.d(TAG, "Clearing whitelist has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to retrieve the list of accounts of a specific account type that are blacklisted for addition by all administrators.
type | account type |
---|
AccountControlInfo
list of the blacklisted accounts along with
the controlling administrator package name if it succeeds else
return null
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to retrieve the list of accounts that are blacklisted by all administrators. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); List<AccountControlInfo> whiteList = edm.getDeviceAccountPolicy() .getAccountsFromAdditionBlackLists(); for (List controlInfo : whiteList) { Log.d(TAG, "Administrator: " + controlInfo.adminPackageName + " Entries : " + controlInfo.entries); } |
// 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); List<AccountControlInfo> whiteList = kcm.getDeviceAccountPolicy() .getAccountsFromAdditionBlackLists(); for (List controlInfo : whiteList) { 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to retrieve the addition whitelist across all administrators for accounts of a specific account type.
type | account type |
---|
AccountControlInfo
list of the whitelisted accounts along with
the controlling administrator package name if it succeeds else
return null
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to retrieve the list of accounts that are whitelisted by all administrators. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); List<AccountControlInfo> whiteList = edm.getDeviceAccountPolicy() .getAccountsFromAdditionWhiteLists(); for (List controlInfo : whiteList) { Log.d(TAG, "Administrator: " + controlInfo.adminPackageName + " Entries : " + controlInfo.entries); } |
// 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); List<AccountControlInfo> whiteList = kcm.getDeviceAccountPolicy() .getAccountsFromAdditionWhiteLists(); for (List controlInfo : whiteList) { 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to retrieve the list of accounts of a specific account type that are blacklisted for removal by all administrators.
type | account type |
---|
AccountControlInfo
list of the blacklisted accounts along with
the controlling administrator package name if it succeeds else
return null
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to retrieve the list of accounts that are blacklisted by all administrators. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); List<AccountControlInfo> whiteList = edm.getDeviceAccountPolicy() .getAccountsFromRemovalBlackLists(); for (List controlInfo : whiteList) { Log.d(TAG, "Administrator: " + controlInfo.adminPackageName + " Entries : " + controlInfo.entries); } |
// 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); List<AccountControlInfo> whiteList = kcm.getDeviceAccountPolicy() .getAccountsFromRemovalBlackLists(); for (List controlInfo : whiteList) { 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to retrieve the removal whitelist across all administrators for accounts of a specific account type.
type | account type |
---|
AccountControlInfo
list of the whitelisted accounts along with
the controlling administrator package name if it succeeds else
return null
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to retrieve the list of accounts that are whitelisted by all administrators. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); List<AccountControlInfo> whiteList = edm.getDeviceAccountPolicy() .getAccountsFromRemovalWhiteLists(); for (List controlInfo : whiteList) { Log.d(TAG, "Administrator: " + controlInfo.adminPackageName + " Entries : " + controlInfo.entries); } |
// 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); List<AccountControlInfo> whiteList = kcm.getDeviceAccountPolicy() .getAccountsFromRemovalWhiteLists(); for (List controlInfo : whiteList) { 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to get a list of supported account types.
string
list of supported account types if it succeeds, else null
.Use this API to get a list of account types that are currently supported for account addition and removal prevention. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove all device accounts of a particular type.
type | The type of account to remove |
---|
SecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove any accounts based on type. For example, to remove all Gmail accounts on the device, pass type as "com.google". |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); DeviceAccountPolicy deviceAccPolicy = edm.getDeviceAccountPolicy(); try { boolean result = deviceAccPolicy.removeAccountsByType( "com.google.com"); if(true == result) { //account deleted successfully } }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 kmcm = ekm.getKnoxContainerManager(containerID); DeviceAccountPolicy deviceAccountPolicy = kmcm.getDeviceAccountPolicy(); try { boolean result = deviceAccountPolicy.removeAccountsByType("com.google.com"); if(true == result) { //account deleted successfully } }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_SECURITY" permission which has a protection level of signature. |
API level 2 |
MDM 2.0 |
User Scope |
API to remove a list of accounts from the account addition blacklist of a specific account type.
type | account type |
---|---|
accounts | accounts list to be removed from blacklist |
true
if the account is successfully removed from blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove accounts from the account blacklist. The user can remove an account with a matching account name that has been removed from the blacklist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().removeAccountsFromAdditionBlackList("com.google", blackList); if (success) { Log.d(TAG, "Addition from blacklist is a success"); } else { Log.d(TAG, "Addition from blacklist is a failure"); } } 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 { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().removeAccountsFromAdditionBlackList("com.google", blackList); if (success) { Log.d(TAG, "Addition from blacklist is a success"); } else { Log.d(TAG, "Addition from blacklist 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove a list of accounts of a specific account type from the account addition whitelist.
type | account type |
---|---|
accounts | accounts list to be removed from whiteList |
true
if the account is successfully removed from whitelist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove accounts from the whitelist. The user cannot add accounts that are removed from the whitelist and match an account name in the blacklist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().removeAccountsFromAdditionWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Addition from whitelist has succeeded"); } else { Log.d(TAG, "Addition from whitelist has failed"); } } 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 { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().removeAccountsFromAdditionWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Addition from whitelist has succeeded"); } else { Log.d(TAG, "Addition from whitelist has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove a list of accounts from the account removal blacklist of a specific account type.
type | account type |
---|---|
accounts | accounts list to be removed from blacklist |
true
if the account is successfully removed from blacklist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove accounts from the account blacklist. The user can remove an account with a matching account name that has been removed from the blacklist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().removeAccountsFromRemovalBlackList("com.google", blackList); if (success) { Log.d(TAG, "Removal from blacklist is a success"); } else { Log.d(TAG, "Removal from blacklist is a failure"); } } 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 { List<String> blackList = new ArrayList<String>(); blackList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().removeAccountsFromRemovalBlackList("com.google", blackList); if (success) { Log.d(TAG, "Removal from blacklist is a success"); } else { Log.d(TAG, "Removal from blacklist 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |
API to remove a list of accounts of a specific account type from the account removal whitelist.
type | account type |
---|---|
accounts | accounts list to be removed from whiteList |
true
if the account is successfully removed from whitelist else
false
on failureSecurityException | If caller does not have required permissions |
---|
An administrator can use this API to remove accounts from the whitelist. The user cannot remov accounts that are removed from the whitelist and match an account name in the blacklist. |
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context); try { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = edm.getDeviceAccountPolicy().removeAccountsFromRemovalWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Removal from whitelist has succeeded"); } else { Log.d(TAG, "Removal from whitelist has failed"); } } 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 { List<String> whiteList = new ArrayList<String>(); whiteList.add(".*@gmail.com"); // Supported account types can be retrieved from getSupoprtedAccountTypes() // For example supported Google account type will be "com.google" boolean success = kcm.getDeviceAccountPolicy().removeAccountsFromRemovalWhiteList("com.google", whiteList); if (success) { Log.d(TAG, "Removal from whitelist has succeeded"); } else { Log.d(TAG, "Removal from whitelist has 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_SECURITY" permission which has a protection level of signature. |
API level 6 |
MDM 4.0 |
User Scope |