Bypass android usb host permission confirmation dialog on Android 9

We can solve it by entering: adb shell su settings put global hidden_api_policy_pre_p_apps 1 settings put global hidden_api_policy_p_apps 1 Restrictions on non-SDK interfaces (Android 9): https://developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces And then grantDevicePermission method will be available again through reflection on Android 9: public static boolean grantAutomaticUsbPermissionRoot(Context context, UsbDevice usbDevice) { try { PackageManager pkgManager = context.getPackageManager(); ApplicationInfo appInfo … Read more

Android usb host api and USB storage

The Android USB Host APIs do not include USB Mass Storage filesystem code, nor as of this writing in 2014 will “stock” Android mount a USB Mass Storage volume at operating system level. To access a USB Mass Storage device using the stock Android USB Host APIs, you must therefore implement in your Application code … Read more