4

I'm developing an application's widget as part of a bigger application. The application contains a ContentProvider which is declared in the manifest.xml as follow:

<provider android:name="aaa.bbb.providers.MyContentProvider"
    android:authorities="aaa.bbb.myprovider"
    android:enabled="true" 
    android:exported="false">
</provider>

As you can see the content provider exported attribute is set to false, since I don't want other applications to access it (accoridng to google's developers guide..). The problem is that this attribute causes the widget to crash when trying to fetch data from the content provider, although it runs from the SAME process (the widget uses a StackView which uses a android.widget.RemoteViewsService) I get:

java.lang.SecurityException: Permission Denial: reading aaa.bbb.providers.MyContentProvider uri content://aaa.bbb.myprovider/users from pid=203, uid=10022 requires null

Now as far as I know, this kind of error occurres when a permission is missing, but it says that permission null is required, and there is no such permission as we all know...

Thanks!

1 Answers1

0

see this Android: java.lang.SecurityException: Permission Denial: start Intent

Community
  • 1
  • 1
Niranj Patel
  • 32,980
  • 10
  • 97
  • 133
  • I read it, but finded nothing to help me. My problem doesn't involve activies, but only a widget and a content provider. –  May 19 '11 at 13:00
  • 2
    OK I think I know where the problem comes from, but I have no solution. In my `RemoteViewsService` there is a `RemoteViewsFactory` class and there I'm overriding the `onDataSetChanged`() method and performs the query against the content provider. For some reason, only when querying the content provider from the `onDataSetChanged()` method, the exception is thorwn (I checked once again what is the process the method run in, and it's the same process as content provider's). –  May 19 '11 at 13:50