Issue
I'm using device owner to run an app in lock task mode.
However, when I connect a PC with adb, the USB Debugging Authorization permission dialog is never shown.After disabling lock task mode, the access request dialog appears as expected.
If I connect a PC that is already authorized its possible to use adb.
I'm aware there's the app whitelist for lock task mode, but I have no idea what package name for the USB Debugging Authorization permission would come under.
String[] whitelist = new String[]{getPackageName(),"com.android.systemui"};
mDevicePolicyManager.setLockTaskPackages(mAdminComponentName,active ? whitelist : new String[]{});
This question is very similar to Allowing access to USB device dialog when in Lock Task Mode and I've tried it - it works for other types of USB devices but not USB Debugging.
Solution
Found the source code in com.android.systemui.usb
String[] whitelist = new String[]{getPackageName(),"com.android.systemui.usb"};
mDevicePolicyManager.setLockTaskPackages(mAdminComponentName, whitelist);
Answered By - mach
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.