文章目录
开发平台基本信息
芯片: QCM6125
版本: Android 13
kernel: msm-4.14
问题描述
设备有usb打印机,调用UsbManager进行打印时,会弹框请求使用usb权限;客户要求能够自动授权usb权限,应用打开即可使用。
解决方法
xml
--- a/frameworks/base/core/res/res/values/config.xml
+++ b/frameworks/base/core/res/res/values/config.xml
@@ -2682,7 +2682,7 @@
<!-- If true, then we do not ask user for permission for apps to connect to USB devices.
Do not set this to true for production devices. Doing so will cause you to fail CTS. -->
- <bool name="config_disableUsbPermissionDialogs">false</bool>
+ <bool name="config_disableUsbPermissionDialogs">true</bool>
<!-- Activity to handle Usb Device connection in USB Host side. Keeping it to null value will
lead into handling it inside system using Intent resolution. Non-null contents will have