- Install the MDM agent in the personal space
- Create a Knox container
- Install the MDM agent inside the container as an admin
- Uninstall the MDM agent that was in the personal space
Call the API method KnoxContainerManager.createContainer(String type, String adminPackageName) and pass the MDM agent as an adminPackage parameter. Once the container is created, it installs the MDM agent inside the container. Then, ownership of the container transfers from the creator to the admin inside the container. The creator of the container loses all claim on the container and cannot apply any of the policies. Hence true BYOD separation is achieved, as the admin resides only inside container.
After creating the container, you call the API method KnoxContainerManager.doSelfUninstall() to uninstall the device admin, thus removing the MDM agent from device.