<grant-uri-permission android:path="string" android:pathPattern="string" android:pathPrefix="string" />
<provider>content: URI. (The authority part of the URI identifies the
content provider.)
Granting permission is a way of enabling clients of the provider that don't
normally have permission to access its data to overcome that restriction on
a one-time basis.
If a content provider's grantUriPermissions
attribute is "true", permission can be granted for any the data under
the provider's purview. However, if that attribute is "false", permission
can be granted only to data subsets that are specified by this element.
A provider can contain any number of <grant-uri-permission> elements.
Each one can specify only one path (only one of the three possible attributes).
For information on how permission is granted, see the
<intent-filter> element's
grantUriPermissions attribute.
만약 컨텐트 프로바이더의 grantUriPermissions 애트리뷰트가 “참true”이라면, 퍼미션은 프로바이더 영역 안의 어떤 데이터에 대해서도 부여될 수 있다. 하지만 만약 그 애트리뷰트가 “거짓false”이라면, 퍼미션은 이 엘리먼트에 의해 지정된 데이터 서브셋subset에 한해서만 부여될 수 있다. 프로바이더는 임의의 개수의 <grant-uri-permission> 엘리먼트를 포함할 수 있다. 각각은 오직 하나의 경로path (세 개의 가능한 애트리뷰트 중 오직 한 개)만 지정할 수 있다.
퍼미션을 부여하는 방법에 관한 정보에 대해서는, <intent-filter> 엘리먼트의 grantUriPermissions 애트리뷰트를 보라.
android:path
android:pathPrefix
android:pathPatternpath attribute specifies a complete path;
permission can be granted only to the particular data subset identified
by that path.
The pathPrefix attribute specifies the initial part of a path;
permission can be granted to all data subsets with paths that share that
initial part.
The pathPattern attribute specifies a complete path, but one
that can contain the following wildcards:
*') matches a sequence of 0 to many occurrences of
the immediately preceding character.A period followed by an asterisk (".*") matches any sequence of
0 to many characters.
Because '\' is used as an escape character when the string is read
from XML (before it is parsed as a pattern), you will need to double-escape:
For example, a literal '*' would be written as "\\*" and a
literal '\' would be written as "\\\\". This is basically
the same as what you would need to write if constructing the string in Java code.
For more information on these types of patterns, see the descriptions of
PATTERN_LITERAL,
PATTERN_PREFIX, and
PATTERN_SIMPLE_GLOB in the
PatternMatcher class.
별표가 마침표 뒤에 나오는 것(“.*”)은 어떤 문자든 0번 이상 발생하는 것을 나타낸다.
문자열이 XML로부터 읽어질 때(그것이 패턴으로써 분석되기 전에) “\”는 이스케이프escape 문자로써 사용되기 때문에, 여러분은 두 개의 이스케이프escape가 필요할 것이다.: 예를 들어 글자 그대로인 ‘*’는 “\\*”로 작성되어질 것이고, 글자 그대로인 ‘\’는 “\\\\”로 작성되어질 것이다. 이것은 여러분이 만약 Java 코드 안에서 문자열을 만들 때 작성할 필요가 있는 것과 기본적으로 같다.
이러한 세 가지 타입의 패턴에 대한 더 많은 정보에 대해서는, PatternMatcher 클래스 안의 PATTERN_LITERAL, PATTERN_PREFIX, 그리고 PATTERN_SIMPLE_GLOB에 대한 설명을 보라.
grantUriPermissions
attribute of the
<provider>
element