Why does the API method call setEnableApplication(), using the Knox SDK, disable the app?

When the container is in the locked state (locked by the MDM admin):

However, upon unlocking the container, every package for which setEnableApplication() had been called, becomes disabled, and disappears from the container's Apps page and home.

This is a normal, application security behavior. In Android 4.4.2, 'Lock container' policy is designed for lost/stolen devices. After locking the container, all of the applications are disabled. Normally, after unlocking the container, container's applications are re-enabled.

However, when someone tries to enable an application, while the container is locked, it is possible, that it is an attempt to scam/steal confidential data. Due to security reasons, the application is removed from the container, and to be able to use it, it needs to be installed again after unlocking the container.

Because of the security context, it is going to be kept in the current state. Currently, we expect that the only policy that should be allowed to be performed on a locked container is unlock(), which actually unlocks the container.