How you combine the app allowlisted for lock task mode and the allowlisting DPC Using the device can't always leave lock task mode. Will depend on the problem you want to solve.A single app package that combines a kiosk (to present content) and a mini DPC.(to allowlist itself for lock task mode).A DPC that’s part of an enterprise mobility management solution, launching theĬustomer’s mobile apps in lock task mode.
The system can run in lock task mode in Android 5.0 or later. Android version support for DPC admin modes Android version Which versions of Android support allowlisting apps by user. The secondary user must be affiliated with the primary user. In Android 9.0 or later a DPC can start any app’s activity into lock task mode.
Val dpm = context.getSystemService(Context.DEVICE_POLICY_SERVICE) Private val APP_PACKAGES = arrayOf(KIOSK_PACKAGE, PLAYER_PACKAGE) CallĭtLockTaskPackages() toĪllowlist apps for lock task mode as shown in the following sample: In earlier versions, the app must already support starting its own activity inĪ DPC must allowlist apps before they can be used in lock task mode. Private static final String PLAYER_PACKAGE = '' Private static final String KIOSK_PACKAGE = '' Val adminName = getComponentName(context)ĭpm.setLockTaskPackages(adminName, APP_PACKAGES) Java // Allowlist two apps. Private static final String APP_PACKAGES = else if (_INT >= Build.VERSION_CODES.