3

I'm writing an enterprise inspired app based on Device Policy Manager. The app will enable kiosk mode on the device so only one app will be in the foreground & the user won't be able to get out of the app.

My app whitelists the particular app that's going to be in the foreground. Everything so far is working great except that when the device is in Kiosk mode, the system dialogs, for example, Bluetooth device pairing dialog and USB accessory permission dialog don't appear on top of the pinned app.

I couldn't find any api that would enable such system dialogs to appear while kiosk mode is in action.

Google added some new apis in Android 9 that let you know that but since my app will be running on devices <= Android Oreo, I can't utilize those apis.

Following api is using to whitelist an app to go in Kiosk Mode,

public void setLockTaskPackages (ComponentName admin, 
                String[] packages)

and then the screen pinned app calls startLockTask() to have full affect of kiosk mode but then system dialogs stop appearing as mentioned above.

Is there any other api that would let the system dialogs to show up? Any pointers/work arounds would be really appreciated

user2498079
  • 2,872
  • 8
  • 32
  • 60

2 Answers2

1

I had to add "com.android.settings" to my LockTaskPackages list.

Dev Chris
  • 11
  • 1
  • Hi man, Can you extende on your asnwer little bit ? I am working with Microsoft endpoint(Intune) and I have this problem. What is LockTaskPackage is it something you set up in the app? – trixo Jan 15 '21 at 15:20
  • HI,i'm not familiar with MS Endpoint But if you are in Android and you enable LockTask mode You can add Packages to a whitelist dpm.setLockTaskPackages(admin, whitelist) These packages are now allowed to run/open apps whilst your app is locked – Dev Chris Jan 18 '21 at 16:45
0

I'm currently developing an enterprise app that has the same issue. My temporary solution has been to unlock the application while I'm expecting to receive the Bluetooth pairing dialog, and then lock the app once the connection has been set up.

So far, this is the only solution I've found to work. If you manage to find a solution, please let me know. It's been a frustrating couple of months trying to fix this.