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 | Indicates that the calling package is already activating/deactivating a license key and must wait the result to try again. | |||||||||
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_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_ERROR_CODE | Used as an integer extra field with ACTION_LICENSE_STATUS . |
|||||||||
String | EXTRA_LICENSE_GRANTED_PERMISSIONS | Used as StringArrayList extra field with ACTION_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_CODE to 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 |
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 |
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 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 foundAPI level 33 |
KNOX 3.7 |