当前位置:   article > 正文

android usb 读写权限,Android默认给予USB读写权限,去掉受权对话框

android应去除usb授权提示框并默认授予权限

去掉USB读写权限受权对话框:

要受权 ES文件浏览器 访问您 *** 上的数据 (包括照片和视频)吗?java

修改:android

--- a/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/OpenExternalDirectoryActivity.java

+++ b/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/OpenExternalDirectoryActivity.java

@@ -454,6 +454,17 @@ public class OpenExternalDirectoryActivity extends Activity {

mActivity.finish();

}

};

+ // Auto granted

+ String pkgName = mActivity.getCallingPackage();

+ android.util.Log.i("AZ", "GRANT.CallingPackage=" + pkgName);

+ if("com.dachen.openlive".equals(pkgName)

+ || "com.dachen.openmeeting".equals(pkgName)

+ || "com.estrongs.android.pop".equals(pkgName)){

+ Intent intent = createGrantedUriPermissionsIntent(mActivity, mActivity.getExternalStorageClient(), mFile);

+ logValidScopedAccessRequest(mActivity, directory, SCOPED_DIRECTORY_ACCESS_GRANTED);

+ mActivity.setResult(RESULT_OK, intent);

+ mActivity.finish();

+ }

@SuppressLint("InflateParams")

// It's ok pass null ViewRoot on AlertDialogs.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/448067?site
推荐阅读
相关标签
  

闽ICP备14008679号