4

So I have an application that is pinned to the device with startLockTask command and it has several restrictions so the user cannot escape from the application or change settings of the device.

However, the user should be able to transfer files from the device to a computer via USB, but when the device is connected to a "new" PC, the USB permission dialog: Allow access to device data is not shown because of the LockTask mode.

Is there any way to open that dialog in front of my application?

Eric Schnipke
  • 482
  • 1
  • 6
  • 22
Marko
  • 43
  • 4

1 Answers1

9

Faced the same problem today,

in my case I solved it by adding com.android.systemui package, while adding my whitelist application's in setLockTaskPackages DPM's method.

After this I can see the dialogue which was blocking up in LockTask mode.

SaravanaRaja
  • 3,228
  • 2
  • 21
  • 29
  • 4
    Thanks a lot! This was not exactly the command that worked but it pushed me to right direction. By adding `com.android.systemui` package I could see the debugging dialog but by adding `com.samsung.android.MtpApplication` I was finally able to see the 'Allow access to device data' dialog. So with Samsung phones this solves the problem and so far it's all I need. – Marko Jul 16 '18 at 06:00
  • 1
    It works for me. I tried both Asus and Lenovo tablets. – fireb86 Nov 19 '18 at 16:19
  • 1
    White-listing `com.android.systemui` did the trick on a Winmate M700D. – Eric Schnipke Jan 13 '20 at 19:41