| java.lang.Object | |
| ↳ | com.samsung.android.knox.license.KnoxEnterpriseLicenseManager | 
This class provides APIs to handle Knox Enterprise license (KLM license) on device.
| API level 7 | 
| KNOX 1.0.1 | 
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | ACTION_LICENSE_STATUS | Broadcast Action : Sent to inform about result of Knox License activation, deactivation or validation. | |||||||||
| int | ERROR_ANOTHER_PROCESS_IN_PLACE | Deprecated
      in API level 36 NOTE: This constant is not available since Android 15 | |||||||||
| int | ERROR_INTERNAL | Indicates that an unexpected error occurred during operation. | |||||||||
| int | ERROR_INTERNAL_SERVER | Indicates that an unexpected error occurred in license server during operation. | |||||||||
| int | ERROR_INVALID_BINDING | Either the application product type does not match with license product type or application is not bound to the given license key. | |||||||||
| int | ERROR_INVALID_LICENSE | Indicates that an invalid license was used in the operation. | |||||||||
| int | ERROR_INVALID_PACKAGE_NAME | Indicates that the license is missing binding to the calling application. | |||||||||
| int | ERROR_LICENSE_ACTIVATION_NOT_FOUND | Indicates that the activation for the device and license was not found. | |||||||||
| int | ERROR_LICENSE_DEACTIVATED | Indicates that the license used in the operation is not active. | |||||||||
| int | ERROR_LICENSE_EXPIRED | Indicates that the license used in the operation is expired. | |||||||||
| int | ERROR_LICENSE_QUANTITY_EXHAUSTED | Indicates that the license used in the operation does not have available seats. | |||||||||
| int | ERROR_LICENSE_QUANTITY_EXHAUSTED_ON_AUTO_RELEASE | Indicates that this device was deactivated from this license due to not validate the license for a long time (automatic seat count release - ASR) and now the license does not have available seats. | |||||||||
| int | ERROR_LICENSE_TERMINATED | Indicates that the license used in the operation is in the terminated status and could not be used. | |||||||||
| int | ERROR_NETWORK_DISCONNECTED | Indicates whether device network connectivity does not exist. | |||||||||
| int | ERROR_NETWORK_GENERAL | Indicates that a network error occurred during the operation. | |||||||||
| int | ERROR_NONE | Indicates that the operation was successfully performed. | |||||||||
| int | ERROR_NOT_CURRENT_DATE | Indicates that device date is different than current date. | |||||||||
| int | ERROR_NULL_PARAMS | Indicates that some operation parameter is invalid. | |||||||||
| int | ERROR_SIGNATURE_MISMATCH | Indicates that the caller package has an invalid signature. | |||||||||
| int | ERROR_TOO_MANY_REQUESTS | Returned when the caller application exceeds the limit of 30 API requests that can be processed within 60 seconds. | |||||||||
| int | ERROR_UNKNOWN | Indicates that an unexpected error occurred during operation. | |||||||||
| int | ERROR_USER_DISAGREES_LICENSE_AGREEMENT | Indicates that Knox End User License Agreement was not accepted. | |||||||||
| String | EXTRA_LICENSE_DATA_TIME_REMAINING_UNTIL_NEXT_LICENSE_REQUEST | Used as long extra field with ACTION_LICENSE_STATUS. | |||||||||
| String | EXTRA_LICENSE_ERROR_CODE | Used as an integer extra field with ACTION_LICENSE_STATUS. | |||||||||
| String | EXTRA_LICENSE_GRANTED_PERMISSIONS | Used as StringArrayListextra field withACTION_LICENSE_STATUS. | |||||||||
| String | EXTRA_LICENSE_RESULT_TYPE | Used as integer extra field with ACTION_LICENSE_STATUS. | |||||||||
| String | EXTRA_LICENSE_STATUS | Deprecated
      Not supported since KNOX 3.2. Use EXTRA_LICENSE_ERROR_CODEto check status. | |||||||||
| int | LICENSE_RESULT_TYPE_ACTIVATION | Indicates that this result refers to a Knox Enterprise license activation. | |||||||||
| int | LICENSE_RESULT_TYPE_DEACTIVATION | Indicates that this result refers to a Knox Enterprise license de-activation. | |||||||||
| int | LICENSE_RESULT_TYPE_VALIDATION | Indicates that this result refers to a Knox Enterprise license validation. | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 
      
  Deprecated
      in API level 37  NOTE: Applications can use activateLicense(String, LicenseResultCallback)since Android 14 to achieve the same result of this API. | |||||||||||
| API to activate a Knox Enterprise license to the calling application with result sent via broadcast. | |||||||||||
| API to activate Knox Enterprise license to the calling application with result sent via callback. | |||||||||||
| 
      
  Deprecated
      in API level 37  NOTE: Applications can use activateLicense(String)since Android 14 to achieve the same result of this API. | |||||||||||
| API to de-activate Knox Enterprise license to the calling application with result sent via callback. | |||||||||||
| API to de-activate a Knox Enterprise license to the calling application with result sent via broadcast. | |||||||||||
| 
      
  Deprecated
      in API level 37  NOTE: Applications can use deActivateLicense(String)since Android 14 to achieve the same result of this API. | |||||||||||
| 
      
  Deprecated
      in API level 37  NOTE: Applications can use deActivateLicense(String, LicenseResultCallback)since Android 14 to achieve the same result of this API. | |||||||||||
| API to create an instance of KnoxEnterpriseLicenseManager class. | |||||||||||
| API to get activation details of KLM activation from calling package. | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  java.lang.Object | |||||||||||
Broadcast Action : Sent to inform about result of Knox License activation, deactivation or validation.
 This targeted broadcast is sent only to the application who called the activateLicense(String) API.
 Also system does periodic validation of KNOX license, administrator continuously needs to listen for this intent after activation.
 The intent will have the following extra value:
 EXTRA_LICENSE_STATUS: 
      "success", "fail". 
 
 EXTRA_LICENSE_ERROR_CODE: 
		ERROR_NONE 
      ERROR_NULL_PARAMS 
      ERROR_UNKNOWN 
      ERROR_INVALID_LICENSE 
      ERROR_LICENSE_TERMINATED 
      ERROR_INTERNAL 
      ERROR_INTERNAL_SERVER 
      ERROR_NETWORK_DISCONNECTED 
      ERROR_NETWORK_GENERAL 
      ERROR_USER_DISAGREES_LICENSE_AGREEMENT 
      ERROR_LICENSE_DEACTIVATED 
      ERROR_LICENSE_EXPIRED 
      ERROR_LICENSE_QUANTITY_EXHAUSTED 
      ERROR_INVALID_PACKAGE_NAME 
      ERROR_LICENSE_ACTIVATION_NOT_FOUND 
 
 EXTRA_LICENSE_RESULT_TYPE: 
		LICENSE_RESULT_TYPE_ACTIVATION 
      LICENSE_RESULT_TYPE_VALIDATION 
      LICENSE_RESULT_TYPE_DEACTIVATION 
      EXTRA_LICENSE_GRANTED_PERMISSIONS 
| API level 7 | 
| KNOX 1.0.1 | 
      
  Deprecated 
      in API level 36 
 NOTE: This constant is not available since Android 15
  
Indicates that the calling package is already activating/deactivating a license key and must wait the result to try again.
| API level 35 | 
| KNOX 3.8 | 
Indicates that an unexpected error occurred during operation.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that an unexpected error occurred in license server during operation.
| API level 7 | 
| KNOX 1.0.1 | 
Either the application product type does not match with license product type or application is not bound to the given license key.
| API level 26 | 
| KNOX 3.2 | 
Indicates that an invalid license was used in the operation.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that the license is missing binding to the calling application.
| API level 10 | 
| KNOX 1.2.0 | 
Indicates that the activation for the device and license was not found.
| API level 10 | 
| KNOX 1.2.0 | 
Indicates that the license used in the operation is not active.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that the license used in the operation is expired.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that the license used in the operation does not have available seats.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that this device was deactivated from this license due to not validate the license for a long time (automatic seat count release - ASR) and now the license does not have available seats.
| API level 26 | 
| KNOX 3.2 | 
Indicates that the license used in the operation is in the terminated status and could not be used.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates whether device network connectivity does not exist.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that a network error occurred during the operation.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that the operation was successfully performed.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that device date is different than current date.
| API level 10 | 
| KNOX 1.2.0 | 
Indicates that some operation parameter is invalid.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that the caller package has an invalid signature. Check license binding.
| API level 10 | 
| KNOX 1.2.0 | 
Returned when the caller application exceeds the limit of 30 API requests that can be processed within 60 seconds.
 The caller application will have to wait for a certain period of time that is indicated by the
 extra EXTRA_LICENSE_DATA_TIME_REMAINING_UNTIL_NEXT_LICENSE_REQUEST before making more requests. 
 To avoid getting this error, implement strategies like caching responses, using exponential backoff for retries,
 and respecting the 30 requests per 60 seconds to avoid hitting the limit again.
| API level 39 | 
| KNOX 3.12 | 
Indicates that an unexpected error occurred during operation.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that Knox End User License Agreement was not accepted.
| API level 7 | 
| KNOX 1.0.1 | 
Used as long extra field with ACTION_LICENSE_STATUS.
 The time remaining in milliseconds that the caller package will have to wait before being able to make a new API call.
 Initial waiting period is 1 minute, but it can increase up to 1 hour in case rate limit is not respected consecutive time frames.
| API level 39 | 
| KNOX 3.12 | 
Used as an integer extra field with ACTION_LICENSE_STATUS. Contains
 the error code of Knox license activation or validation result. In case of success, this extra will contain ERROR_NONE.
| API level 7 | 
| KNOX 1.0.1 | 
Used as StringArrayList extra field with ACTION_LICENSE_STATUS.
 Contains the list of permissions given after an activation or validation.
| API level 30 | 
| KNOX 3.4.1 | 
Used as integer extra field with ACTION_LICENSE_STATUS.
 This will tell whether this is activation, validation or deactivation result.
| API level 7 | 
| KNOX 1.0.1 | 
      
  Deprecated 
      Not supported since KNOX 3.2. Use EXTRA_LICENSE_ERROR_CODE to check status.
  
Used as String extra field with ACTION_LICENSE_STATUS.
 Contains the result of the Knox license activation or validation.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that this result refers to a Knox Enterprise license activation.
| API level 7 | 
| KNOX 1.0.1 | 
Indicates that this result refers to a Knox Enterprise license de-activation.
| API level 10 | 
| KNOX 1.2.0 | 
Indicates that this result refers to a Knox Enterprise license validation.
| API level 7 | 
| KNOX 1.0.1 | 
      
  Deprecated 
      in API level 37 
 NOTE: Applications can use activateLicense(String, LicenseResultCallback) since Android 14 to achieve the same result of this API.
  
API to activate Knox Enterprise license to the calling application with result sent via callback.
 KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context);
 String knoxLicenseKey = "KLM11-.....";
 mgr.activateLicense(knoxLicenseKey, context.getPackageName(), (licenseResult) -> {
     Log.w("License result arrived.");
 });
 | knoxLicenseKey | provided by the calling application | 
|---|---|
| pkgName | package name of the application calling this API. | 
| callback | called when results are ready | 
| API level 35 | 
| KNOX 3.8 | 
API to activate a Knox Enterprise license to the calling application with result sent via broadcast. This targeted broadcast is sent only to the application who called this API.
KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context); String knoxLicenseKey = "KLM11-....."; mgr.activateLicense(knoxLicenseKey);
 The result of license activation is then notified through
 an intent ACTION_LICENSE_STATUS. 
| knoxLicenseKey | provided by the calling application | 
|---|
| API level 7 | 
| KNOX 1.0.1 | 
API to activate Knox Enterprise license to the calling application with result sent via callback.
 KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context);
 String knoxLicenseKey = "KLM11-.....";
 mgr.activateLicense(knoxLicenseKey, (licenseResult) -> {
     Log.w("License result arrived.");
 });
 | knoxLicenseKey | provided by the calling application | 
|---|---|
| callback | called when results are ready | 
| API level 35 | 
| KNOX 3.8 | 
      
  Deprecated 
      in API level 37 
 NOTE: Applications can use activateLicense(String) since Android 14 to achieve the same result of this API.
  
API to activate a Knox Enterprise license to the calling application with result sent via broadcast. This targeted broadcast is sent only to the application who called this API.
KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context); String licenseKey = "KLM11-....."; mgr.activateLicense(licenseKey, context.getPackageName());
 The result of license activation is then notified through
 an intent ACTION_LICENSE_STATUS. 
| knoxLicenseKey | provided by the calling application | 
|---|---|
| pkgName | package name of the calling application | 
| API level 11 | 
| KNOX 2.0 | 
API to de-activate Knox Enterprise license to the calling application with result sent via callback.
 KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context);
 String knoxLicenseKey = "KLM11-.....";
 mgr.deActivateLicense(knoxLicenseKey, (licenseResult) -> {
     Log.w("License result arrived.");
 });
 | knoxLicenseKey | provided by the calling application | 
|---|---|
| callback | called when results are ready | 
| API level 35 | 
| KNOX 3.8 | 
API to de-activate a Knox Enterprise license to the calling application with result sent via broadcast. This targeted broadcast is sent only to the application who called this API.
KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context); String knoxLicenseKey = "KLM11-....."; mgr.deActivateLicense(knoxLicenseKey);
 The result of license de-activation is then notified through
 an intent ACTION_LICENSE_STATUS. 
| knoxLicenseKey | provided by the calling application | 
|---|
| API level 10 | 
| KNOX 1.2.0 | 
      
  Deprecated 
      in API level 37 
 NOTE: Applications can use deActivateLicense(String) since Android 14 to achieve the same result of this API.
  
API to de-activate Knox Enterprise license to the calling application with result sent via broadcast. This targeted broadcast is sent only to the application who called this API.
KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context); String knoxLicenseKey = "KLM11-....."; mgr.deActivateLicense(knoxLicenseKey, context.getPackageName());
 The result of license activation is then notified through
 an intent ACTION_LICENSE_STATUS. 
| knoxLicenseKey | provided by the calling application | 
|---|---|
| pkgName | package name of the application calling this API. | 
| API level 11 | 
| KNOX 2.0 | 
      
  Deprecated 
      in API level 37 
 NOTE: Applications can use deActivateLicense(String, LicenseResultCallback) since Android 14 to achieve the same result of this API.
  
API to de-activate Knox Enterprise license to the calling application with result sent via callback.
 KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context);
 String knoxLicenseKey = "KLM11-.....";
 mgr.deActivateLicense(knoxLicenseKey, context.getPackageName(), (licenseResult) -> {
     Log.w("License result arrived.");
 });
 | knoxLicenseKey | provided by the calling application | 
|---|---|
| pkgName | package name of the application calling this API. | 
| callback | called when results are ready | 
| API level 35 | 
| KNOX 3.8 | 
API to create an instance of KnoxEnterpriseLicenseManager class.
| context | context of the application or service using this class | 
|---|
KnoxEnterpriseLicenseManager object, else null| Used to get access to KnoxEnterpriseLicenseManager object 
 KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context); | 
| API level 7 | 
| KNOX 1.0.1 | 
API to get activation details of KLM activation from calling package.
KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(context); ActivationInfo callerActivationInfo = mgr.getLicenseActivationInfo();
ActivationInfo object or null if no activations found| API level 33 | 
| KNOX 3.7 |