Hello, I have a very strange bug with my content provider, and I don't know 
why.

I have 2 applications, 

1 : it is for having an UI to change parameters and it's hosting the 
content provider with all the parameters
2 : it is display some text and it's using the parameters stored in the 
content provider of the first app.

I have declared a content provider in my first app : 

 <provider

            android:name=
"com.telorion.core.parameters.ParametersContentProvider"

            android:authorities=
"com.telorion.core.parameters.ParametersContentProvider"

            android:multiprocess="true"            

            android:readPermission=
"com.telorion.core.parameters.READ_PARAMETERS"

            android:writePermission=
"com.telorion.core.parameters.WRITE_PARAMETERS" />


with the specific permission : 

<permission

        android:name="com.telorion.core.parameters.READ_PARAMETERS"

        android:description="@string/parameter_read_description"

        android:label="@string/parameter_read_label"

        android:protectionLevel="normal" />



and in both apps, i've setted "<uses-permission android:name=
"com.telorion.core.parameters.READ_PARAMETERS" />" 

In the second app (who has not the content provider), it works like a 
charm, no problem at all.

But in the first app who host the content provider, it works at begin, but 
after few calls, I've got this : 


04-27 16:11:21.618: E/android(10922): Permission Denial: reading 
com.telorion.core.parameters.ParametersContentProvider uri 
content://com.telorion.core.parameters.ParametersContentProvider/telorionparameters
 
from pid=0, uid=10024 requires com.telorion.core.parameters.READ_PARAMETERS

04-27 16:11:21.618: E/android(10922): java.lang.SecurityException: 
Permission Denial: reading 
com.telorion.core.parameters.ParametersContentProvider uri 
content://com.telorion.core.parameters.ParametersContentProvider/telorionparameters
 
from pid=0, uid=10024 requires com.telorion.core.parameters.READ_PARAMETERS

04-27 16:11:21.618: E/android(10922): at 
android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:295)

04-27 16:11:21.618: E/android(10922): at 
android.content.ContentProvider$Transport.query(ContentProvider.java:177)

04-27 16:11:21.618: E/android(10922): at 
android.content.ContentResolver.query(ContentResolver.java:311).

And I don't understand why.


I've tried to create a third app who is using the content provider, and it 
worked without any problems. So the problem is coming from the first app 
who is hosting my content provider. But I don't know why after some calls I 
have a "permission denial". Can somebody help me ?

Thanks a lot for you help :)

NB : When I remove the "readPermission" it works well in my 2 apps. But I 
don't want all apps can use it.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to