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