Knox configure & KPE License

Hello, I am Android developer and I am developing an application with Knox SDK functions for my company. Currently, I am facing some issues, hope you can help me to figure it out.

First, somehow there will be a situation that the Knox function is not working(test function: applicationPolicy.setEnableApplication & applicationPolicy.setDisableApplication).

EnterpriseDeviceManagerService: is permission granted: false
KnoxManager: hide apps Exception: java.lang.SecurityException: Admin does not have android.permission.sec.MDM_APP_MGMT OR

Non-fatal Exception: java.lang.SecurityException
Admin does not have android.permission.sec.MDM_APP_MGMT OR
android.os.Parcel.createException (
android.os.Parcel.readException (
android.os.Parcel.readException ($Stub$Proxy.setApplicationState ( (
com.hk180c.parsonkid.knox.knox.KnoxManager.setEnableApplication (KnoxManager.kt:399)
com.hk180c.parsonkid.knox.knox.KnoxJobScheduler.showAllApps (KnoxJobScheduler.kt:914)
com.hk180c.parsonkid.knox.knox.KnoxJobScheduler.access$showAllApps (KnoxJobScheduler.kt:49)
com.hk180c.parsonkid.knox.knox.KnoxJobScheduler$UnLockAppAsyncTask.doInBackground (KnoxJobScheduler.kt:1497)
com.hk180c.parsonkid.knox.knox.KnoxJobScheduler$UnLockAppAsyncTask.doInBackground (KnoxJobScheduler.kt:1487)
android.os.AsyncTask$ ( (
android.os.AsyncTask$SerialExecutor$ (
java.util.concurrent.ThreadPoolExecutor.runWorker (
java.util.concurrent.ThreadPoolExecutor$ ( (

But the fact is I have add those permissions in AndroidManifest.xml. The flow is I am using Knox Configure to set the profile for the device. The Knox Configure Profile will help me to download the application and set up some restriction that had set on the profile and grant app’s device admin. During the setting up of Knox configure Profile on the device, I see a Toast that said “Knox activation success”, that is why I am not going to use KPE license and “KnoxEnterpriseLicenseManager.activateLicense” to activate Knox License, since Knox Configure has done this for me.

I do not know the exact problem is, is it somehow the license get deactivated or permission get missed, until I activate the license again, then the functions work again. When I was facing this issue, I activate the KPE license using “KnoxEnterpriseLicenseManager.activateLicense” in the app by myself before only using Knox Configure, but this is not the efficiency way to fix that issue, since I do not sure when does it will happen. And other way to fix that issue is that I need to reboot the device, then the functions will work again. Those methods are not ideal to fix the issue.

I have tested on two device Samsung A51 & A71. Most likely, the issue was happened on A51. Both devices are only using Knox Configure Profile and not using “KnoxEnterpriseLicenseManager.activateLicense” to activate Knox functions.

Second, I found out that devices with Knox Configure Profile, the searchBar in app page has a problem. When I click or touch the searchBar, all the apps will disappear and a Toast with message “no apps can perform this action” pop up, until I click Home Button, the apps will show up again. the searchBar looks like that is being disabled like using “applicationPolicy.setDisableApplication)”

Those are my findings, hope there is someone can help. Thank you very much.