Open 3rd party application(It is also my application) from a application in KIOSK mode android L(5.1 api level 22)

384 views Asked by At

I have successfully implemented KIOSK mode application and I am able to block the user to particular application.My requirement is,I have to enable KIOSK mode in my tablet using my application and then I need to allow user to open 3rd party(my another) application which is pre installed in my tablet through my KIOSK app.I am able to open the application from a samsung s6 edge with Android N(api 25) and Marshmallow device(api 23).But when I tested with samsung 5.1 tablet,I am unable to open my application through Kisok app.It is showing me "Screen is pinned.Unpinning isn't allowed by your organisation."Any help is appreciated.

I have added my two applications(Kisok and my application) package names when setting lock mode.Same piece of code is working on 6.0,6.1,7.0,7.1 but not in 5.1.

1

There are 1 answers

1
Fred On

This question seems similar to this other question. Kiosk features have been significantly improved in Android Marshmallow which might explain why you cannot achieve the same behavior on Android Lollipop.

The Android Management API provided by Google should offer backward compatibility on Android Lollipop, and in particular allow to run an app in kiosk mode with the following policy copied from this page of documentation.

"applications": [
  {
    "packageName": "com.example.custom_launcher",
    "installType": "FORCE_INSTALLED",
    "lockTaskAllowed": true,
    "defaultPermissionPolicy": "GRANT",
  },
  {
    "packageName": "com.example.app1",
    "installType": "FORCE_INSTALLED",
    "lockTaskAllowed": true,
    "defaultPermissionPolicy": "GRANT",
  }
],
"persistentPreferredActivities": [
  {
    "receiverActivity": "com.example.custom_launcher",
    "actions": [
      "android.intent.action.MAIN"
    ],
    "categories": [
      "android.intent.category.HOME",
      "android.intent.category.DEFAULT"
    ]
  }
]