startLockTask() not working in Kiosk mode using Android Management API

414 views Asked by At

I am using Android Management API to deploy my app in Kiosk mode. I am calling startLockTask() to try and pin the app to the foreground. This does not work in when using Android Management API. Is there something I need to whitelist in the policy? many thanks

The Android Management API policy looks like this:

{
      "name": "enterprises/XXXXXX/policies/default",
      "applications": [
        {
          "packageName": "com.MY_APP",
          "installType": "KIOSK",
          "defaultPermissionPolicy": "GRANT",
          "minimumVersionCode": 24
        },
        {
          "packageName": "com.android.settings",
          "installType": "FORCE_INSTALLED",
          "defaultPermissionPolicy": "GRANT"
        },

        {
          "packageName": "com.android.systemui",
          "installType": "FORCE_INSTALLED",
          "defaultPermissionPolicy": "GRANT"
        },
      ],
      "systemUpdate": {
        "type": "WINDOWED",
        "startMinutes": 10,
        "endMinutes": 1439
      },
      "keyguardDisabled": true,
      "debuggingFeaturesAllowed": true
}
1

There are 1 answers

0
theo On

Hope you found an answer as I can see there was no response in the past few months. So this question is not relevant to Android Management API as this is an API part of Android App Activity per https://developer.android.com/reference/android/app/Activity#startLockTask(). You might already have found an answer to your question but sharing just in case :)

Theo L Android Enterprise.