java.lang.Object | |
↳ | com.samsung.android.knox.net.billing.EnterpriseBillingPolicy |
Deprecated
in API level 33
NOTE: This Class is not available since Android 12.
This class provides APIs to set up and manage Enterprise Billing on KNOX devices.
KNOX enterprise billing separates the bill generation for personal and enterprise data usage. In Dual-APN approach, two different APNs (Access Point Name) are used. This feature assumes that the network is capable of multiple simultaneous data connections on these 2 APNs. One connection is made using default APN and used to route personal mode traffic, while another connection is made using enterprise APN and used to route the traffic from container apps. At network side the Operator can meter the two connections and generate separate bills for IMSI.
The EnterpriseBilling APIs are invoked by MDM which creates and owns the container on KNOX Device.
To setup split billing, MDM should first create a EnterpriseBillingProfile
and then bind one or more containers to the profile.
API level 13 |
KNOX 2.2 |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ALL_APPS_IN_SCOPE |
Deprecated
in API level 33 NOTE: This Variable is not available since Android 12. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. | |||||||||||
Deprecated
in API level 33
NOTE: This API is not available since Android 12. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Deprecated
in API level 33
NOTE: This Variable is not available since Android 12.
This is to refer complete scope during bind & unbind operation
API level 13 |
KNOX 2.2 |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to set policy which activates or deactivates enterprise data connection for a particular profile.
On activate, enterprise data connection is made and containers/apps bound to this profile are routed
over this connection, while personal apps work on default connection.
On deactivate, enterprise data connection is disconnected. All apps in the device will work on default connection.
ebProfileName | the profile name |
---|---|
activate | true to activate, false to deactivate |
true
if setting is updated, false
in case of any errorSecurityException | If caller does not have required permissions. |
---|
Admin can make use of this API to activate or deactivate enterprise data connection for a particular profile
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { //activate will be either true or false bool retVal = policy.activateProfile(ebProfileName, activate); if(retVal==true) { // activated / deactivated successfully } else { // The profile doesn't exists } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { //activate will be either true or false bool retVal = policy.activateProfile(ebProfileName, activate); if(retVal==true) { // activated / deactivated successfully } else { // The profile doesn't exists } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to set policy which allows or disallows Enterprise connection while device is in roaming network.
If allowed, enterprise data connection is brought up and container traffic is routed over it.
If disallowed, container traffic uses the default connection (which depends on User setting for Roaming Data)
ebProfileName | the profile name |
---|---|
allow | true if roaming should be allowed, false if roaming should be disallowed |
true
if success, false
in case of any errorSecurityException | If caller does not have required permissions. |
---|
Admin can make use of this API to allow or disallow the Enterprise Billing when in roaming
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { // allow will be either true or false policy.allowRoaming(ebProfileName, allow); } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { // allow will be either true or false policy.allowRoaming(ebProfileName, allow); } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to bind the list of applications to a billing profile and activates it, if not already done.
During activation, device pre-conditions are checked and a new data connection is made on enterprise APN set in the profile and the data from these applications will be routed over the enterprise data connection.
ebProfileName | the profile name |
---|---|
packageList | list of packages to be bound to profile |
true
if operation is successful, else false
SecurityException | If caller does not have required permissions. |
---|
Method of binding the list of applications at owner user space(outside container) to the profile and EnterpriseBilling is enabled for that application list
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); List |
Method of binding the container to the profile and EnterpriseBilling is enabled for that container
// 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to bind VPN connection to the billing profile.
After invoking this API, the data traffic corresponding to this VPN connection (profile) will be routed over the Enterprise data connection.
VPN profile can be based on either com.sec.enterprise.knox.EnterprisePremiumVpnPolicy or com.sec.enterprise.knox.GenericVpnPolicy
ebProfileName | Billing profile name |
---|---|
vpnProfileName | VPN profile name ,may or may not be available at this time |
vpnPackageName | Package name of VPN engine, may or may not be available at this time |
true
if successful, false
in case of errorSecurityException | If caller does not have required permissions. |
---|
Call this API with billing profile name, vpn profile name and VPN client package
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.bindVpnToProfile(ebProfileName, vpnProfileName, vpnPackageName); if(retVal==true) { // VPN engine details are successfully added to given EnterpriseBilling profile } else { // Operation failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.bindVpnToProfile(ebProfileName, vpnProfileName, vpnPackageName); if(retVal==true) { // VPN engine details are successfully added to given EnterpriseBilling profile } else { // Operation failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to create a new billing profile for this Admin.
ebProfile | to be added into device |
---|
true
if operation is accepted successfully, false
if profile addition has failedSecurityException | If caller does not have required permissions. |
---|
The first step in using EnterpriseBilling feature is to create profile. This profile information like APN details (apn, mcc,mnc).
Profile detail is used while activating the EnterpriseBilling for a container or application. EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = new EnterpriseBillingProfile(profileName); ebProfile.addApnsToProfile(apns);// adds a list of EnterpriseApn if(ebProfile != null) { boolean retVal = policy.createProfile(ebProfile); if(retVal==true) { // ebProfile is created successfully } else { // ebProfile creation has failed } } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = new EnterpriseBillingProfile(profileName); ebProfile.addApnsToProfile(apns);// adds a list of EnterpriseApn if(ebProfile != null) { boolean retVal = policy.createProfile(ebProfile); if(retVal==true) { // ebProfile is created successfully } else { // ebProfile creation has failed } } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to get the list of applications which are bound to given profile.
ebProfileName | the profile name |
---|
null
if no app is assignedSecurityException | If caller does not have required permissions. |
---|
Call this API with profile name for which you want to fetch the assigned applications
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { List |
// 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { List |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to get the list of billing profiles created by the calling admin.
null
if no profiles were createdSecurityException | If caller does not have required permissions. |
---|
Invoke the API to get the list of available profiles created earlier EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); try { List |
// 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); EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); try { List
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to get the billing profile to which the application/container is currently bound
packageName | the package name |
---|
null
in case of errorSecurityException | If caller does not have required permissions. |
---|
Method of getting the EnterpriseBilling Profile for User Space(Outside Container) Application
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = policy.getBoundedProfile(packageName); if(ebProfile!=null) { // profile detail is fetched } else { // no corresponding profile detail is found } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
Method of getting the EnterpriseBilling Profile for Container(Use * for Container)
// 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { //packageName = ALL_APPS_IN_SCOPE for all EnterpriseBillingProfile ebProfile = policy.getBoundedProfile(packageName); if(ebProfile!=null) { // profile detail is fetched } else { // no corresponding profile detail is found } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } This Api for container application works since knox 2.4 only Method of getting the EnterpriseBilling Profile for Container Space(Inside Container) Application
// 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { //packageName = Inside Container Application EnterpriseBillingProfile ebProfile = policy.getBoundedProfile(packageName); if(ebProfile!=null) { // profile detail is fetched } else { // no corresponding profile detail is found } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to get the details of an existing profile.
ebProfileName | the profile name |
---|
EnterpriseBillingProfile
if matching profile is found, else null
SecurityException | If caller does not have required permissions. |
---|
This API will return the profile detail corresponding to given profile Name
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = policy.getProfileDetails(ebProfileName); if(ebProfile!=null) { // profile successfully retrieved } else { // operation failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = policy.getProfileDetails(ebProfileName); if(ebProfile!=null) { // profile successfully retrieved } else { // operation failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to check whether Enterprise connection is activated for a profile.
ebProfileName | the billing profile name |
---|
true
if is activated, false
if deactivated or errorSecurityException | If caller does not have required permissions. |
---|
Admin can make use of this API to check whether Enterprise connection is activated for a profile
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { bool retVal = policy.isProfileActive(ebProfileName); if(retVal==true) { // Current profile is active } else { // Current profile is inactive } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { bool retVal = policy.isProfileActive(ebProfileName); if(retVal==true) { // Current profile is active } else { // Current profile is inactive } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to check whether Roaming is allowed or disallowed for given billing profile
ebProfileName | the profile name |
---|
true
if is roaming allowed, false
if notSecurityException | If caller does not have required permissions. |
---|
Admin can make use of this API to check whether Enterprise Roaming is allowed or disallowed for given profile name
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.isRoamingAllowed(ebProfileName); if(retVal==true) { // Roaming is enabled for given billing profile } else { // Roaming is not enabled for given billing profile } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.isRoamingAllowed(ebProfileName); if(retVal==true) { // Roaming is enabled for given billing profile } else { // Roaming is not enabled for given billing profile } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to remove a billing profile from device.
ebProfileName | the profile name |
---|
true
if operation is accepted successfully, false
if profile removal has failedSecurityException | If caller does not have required permissions. |
---|
Call this API to remove an already created profile.
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.removeProfile(ebProfileName); if(retVal==true) { // profile removed successfully } else { // profile removal has failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.removeProfile(ebProfileName); if(retVal==true) { // profile removed successfully } else { // profile removal has failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to unbind the list of application from billing profile and deactivates it, if no more containers or applications are bound to the profile.
ebProfileName | the profile name |
---|---|
packageList | list of packages to be un-bound from profile |
true
if operation is successful, else false
SecurityException | If caller does not have required permissions. |
---|
Method of unbinding the list of applications at owner user space (outside container) from the profile and EnterpriseBilling is disabled for that application list
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); List |
Method of unbinding the container from the profile and EnterpriseBilling is disabled for that container
// 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 This Api for container application works since knox 2.4 only Method of unbinding the list of applications at container space(inside container) from the profile and EnterpriseBilling is disabled for that application list
// 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
|
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to unbind VPN connection from the billing profile.
After invoking this API, the data traffic corresponding to this VPN connection (profile)
will be routed over the default data connection and billed to user.
ebProfileName | the billing profile name |
---|---|
vpnProfileName | the vpn profile name,may or may not be available at this time |
true
if successful, false
in case of errorSecurityException | If caller does not have required permissions. |
---|
This API will remove VPN connection detail from EnterpriseBilling
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.unbindVpnFromProfile(ebProfileName,vpnProfileName); if(retVal==true) { // VPN engine details is successfully removed } else { // Operation failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { boolean retVal = policy.unbindVpnFromProfile(ebProfileName,vpnProfileName); if(retVal==true) { // VPN engine details is successfully removed } else { // Operation failed } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |
Deprecated
in API level 33
NOTE: This API is not available since Android 12.
API to update an existing profile previously created by this Admin.
ebProfile | the profile |
---|
true
if operation is accepted successfully, false
if profile updation has failedSecurityException | If caller does not have required permissions. |
---|
If MDM wants to update any existing profile then this API can be used. All the previous values will be erased and it will be replaced with new profile value.
EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance(context); try { EnterpriseBillingPolicy policy = ekm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = policy.getProfileDetails(ebProfileName); if(ebProfile != null) { //make changes on ebProfile object boolean retVal = policy.updateProfile(ebProfile); if(retVal==true) { // ebProfile is updated successfully } else { // ebProfile updation has failed } } } } catch (SecurityException e) { Log.w(TAG, "Exception" + 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 { EnterpriseBillingPolicy policy = kcm.getEnterpriseBillingPolicy(); if(policy != null) { EnterpriseBillingProfile ebProfile = policy.getProfileDetails(ebProfileName); if(ebProfile != null) { //make changes on ebProfile object boolean retVal = policy.updateProfile(ebProfile); if(retVal==true) { // ebProfile is updated successfully } else { // ebProfile updation has failed } } } } catch (SecurityException e) { Log.w(TAG, "Exception" + e); } |
The use of this API requires the caller to have the "com.samsung.android.knox.permission.KNOX_EBILLING" permission which has a protection level of signature. |
API level 13 |
KNOX 2.2 |
User Scope |