Permission to a content provider when accessed via android.widget.RemoteViewsService

I am developing an application widget as part of a larger application. The application contains a ContentProvider, which is declared in the manifest.xml file as follows:

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

As you can see, the attribute of the exported content was set to false, since I do not want other applications to access it (according to the Google Developers Guide ..). The problem is that this attribute causes the widget to crash when trying to get data from the content provider, although it is executed from the SAME of the process (the widget uses StackView, which uses 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, such an error occurs when there is no permission, but it says that null permission is required, and there is no such permission as we all know ...

Thanks!

+4
source share

All Articles