内容提供商授予uri权限 [英] Content provider grant uri permission

查看:147
本文介绍了内容提供商授予uri权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索并阅读了android开发人员文件,但对于内容提供商授予uri权限没有找到满意的答案.谁能解释得更详细,更简单.我的问题是: uri用途是什么? grant uri许可true和false有什么区别 什么时候应该使用true?什么时候假? 和任何更多的细节表示赞赏.

I searched and read android developer files but I did not find any satisfactory answer for content provider grant uri permission. Can anybody explain more detailed and more simple. My questions are: What grant uri is using for? What is the differences between grant uri permission true and false When we should use true? when false? and any more detail are appreciated.

推荐答案

Grant uri的用途是什么?

What grant uri is using for?

授予Uri权限"功能使您可以拥有通常无法被第三方访问的ContentProvider,但可以选择性地允许在短时间内访问各个第三方应用程序的各个Uri值(例如,足够长的时间以查看提供者提供的PDF).

The "grant Uri permissions" feature allows you to have a ContentProvider that is normally inaccessible by third parties, yet selectively allow access to individual Uri values to individual third-party apps for a short period of time (e.g., long enough to view the PDF that the provider serves).

grant uri许可真假之间有什么区别

What is the differences between grant uri permission true and false

android:grantUriPermissions="true"表示您的Java代码可以对ContentProvider服务的任何Uri使用FLAG_GRANT_READ_URI_PERMISSIONFLAG_GRANT_WRITE_URI_PERMISSION.

android:grantUriPermissions="true" indicates that your Java code can use FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION for any Uri served by that ContentProvider.

android:grantUriPermissions="false"表示只有子<grant-uri-permission>元素指定的Uri值可以与FLAG_GRANT_READ_URI_PERMISSIONFLAG_GRANT_WRITE_URI_PERMISSION一起使用.

android:grantUriPermissions="false" indicates that only the Uri values specified by child <grant-uri-permission> elements can be used with FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION.

这篇关于内容提供商授予uri权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆