Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content provider grant uri permission

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.

like image 472
Android Avatar asked Apr 10 '14 13:04

Android


1 Answers

What grant uri is using for?

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).

What is the differences between grant uri permission true and false

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" 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.

like image 194
CommonsWare Avatar answered Oct 05 '22 09:10

CommonsWare