Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentProvider中定义的权限,本应用中使用是否不需要验证权限? #20

Open
qingfengmy opened this issue Jun 17, 2016 · 1 comment

Comments

@qingfengmy
Copy link

如定义权限如下:

<permission
        android:name="qingfengmy.developmentofart.provider"
        android:protectionLevel="normal" />

定义provider如下:

<provider
            android:name="._2activity.ContentProvider.BookProvider"
            android:authorities="qingfengmy.developmentofart.bookprovider"
            android:exported="true"
            android:permission="qingfengmy.developmentofart.provider"
            android:process=":provider" />

那么在当前应用的Activity中不需要添加如下权限,也可以调用provider的query方法。

<uses-permission android:name="qingfengmy.developmentofart.provider"/>

尽管Activity和provide不是同一进程,但是同一应用,同一应用就可以忽略provider的permission,是否如此?

@wargame22
Copy link

1.A provider's application can specify permissions that other applications must have in order to access the provider's data
2. However, components in the provider's application always have full read and write access, regardless of the specified permissions.

from : https://developer.android.com/guide/topics/providers/content-provider-basics.html#Permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants