This sample shows how to enable lock task mode in other installed apps, and turn them into a screen pinned kiosk.
For more information check out my blogpost www.sisik.eu/blog/android/dev-admin/other-apps-lock-task
You can use my Bugjaeger app to activate device owner mode (and execute other shell commands) <a target="_blank" href="https://play.google.com/store/apps/details?id=eu.sisik.hackendebug>play.google.com/store/apps/details?id=eu.sisik.hackendebug