AndroidManifest. xml file (grant-uri-permission)

Source: Internet
Author: User

SYNTAX (SYNTAX ):

<Grant-uri-permissionandroid: path = "string"
Android: pathPattern = "string"
Android: pathPrefix = "string"/>

Included IN (contained in)

<Provider>

DESCRIPTION ):

This element is used to authorize the data subset of the content provider. A Data subset is identified by the content: URI path. Authorization is a capability provided by the provisioner to the client, so that the customer can access data that is usually not authorized to access, so as to overcome the restrictions based on a single access.

If the grantUriPermissions attribute of the content provider is set to true, the permission can be granted to any data within the scope of the content provider. However, if the grantUriPermission attribute is set to false, the permission can only be granted to the data subset specified by this element. A content provider can contain any number of <grant-uri-permission> elements. You can specify only one path (one of the three possible attributes ).

For more information about how to grant permissions, see the grantUriPermissions attribute of the <intet-filter> element.

ATTRIBUTES (ATTRIBUTES ):

Android: path

Android: pathprefix

Android: pathPattern

A path identifies one or more data subsets that can be authorized. The path attribute specifies a complete path. permissions can only be granted to specific data subsets identified by this path. The pathPrefix attribute specifies the initial part of the path, and the permission can be granted to share all data subsets of the initial path. The pathPattern attribute specifies a complete path, but this path contains wildcards:

1. asterisk (*) is a wildcard. * Asterisk in the path represents the character before any number of asterisks, such as a *, which can be a, aa, aaa, aaaa ,... string matching.

2. A combination of dots and asterisks (. *) wildcard, which can be matched with any string, such as. * HTML, which can be followed by abchhtml?chtml=html#dssf.html ,... .

Because the system uses the '\' symbol as a mandatory escape character when reading a string in XML, it needs to be escaped twice. For example, the "*" symbol must be written as "\ *", and the '\' symbol must be written "\\\\". This is basically the same as writing in Java code.

For more information about the three modes, see the descriptions of PATTERN_LITERAL, PATTERN_PREFIX, and PATTERN_SIMPLE_GLOB in the PatternMatcher class.

Http://developer.android.com/reference/android/ OS /PatternMatcher.html

Introduction version (introduced in)

API Level 1.

 


From FireOfStar's column

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.