- 문법:
<permission-tree android:icon="drawable resource" android:label="string resource" android:name="string" />
- 포함된 위치:
<manifest>
- 설명:
- 권한 트리의 기본 이름을 선언합니다. 애플리케이션은 트리 내의 모든 이름의 소유권을 가집니다.
PackageManager.addPermission()
을 호출하여 동적으로 새 권한을 트리에 추가할 수 있습니다. 트리 내에서 이름은 마침표('.
')로 구분됩니다. 예를 들어 기본 이름이com.example.project.taxes
이면 다음과 같은 권한이 추가될 수 있습니다.com.example.project.taxes.CALCULATE
com.example.project.taxes.deductions.STORE_RECEIPTS
com.example.project.taxes.deductions.ACCESS_RECORDS
이 요소는 권한 자체를 선언하지 않으며, 권한을 배치할 수 있는 네임스페이스만 선언합니다. 권한 선언에 관한 자세한 내용은
<permission>
요소를 참고하세요. - 속성:
android:icon
- 트리의 모든 권한을 나타내는 아이콘입니다. 이 속성은 이미지 정의가 포함된 드로어블 리소스의 참조로 설정해야 합니다.
android:label
- 사용자가 읽을 수 있는 그룹 이름입니다. 편의상 라벨은 개발 중에 원시 문자열로 직접 설정할 수 있습니다. 그러나 애플리케이션을 게시할 준비가 되면 사용자 인터페이스의 다른 문자열처럼 현지화할 수 있도록 문자열 리소스의 참조로 설정합니다.
android:name
- 권한 트리 하단에 있는 이름입니다. 트리 내 모든 권한 이름의 접두사 역할을 합니다. Java 스타일의 스코핑을 사용하여 이름이 고유하도록 합니다. 이름의 경로에 마침표로 구분된 세그먼트가 3개 이상 있어야 합니다. 예를 들어
com.example.base
는 괜찮지만com.example
은 그렇지 않습니다.
- 도입 수준:
- API 수준 1
- 참고 항목:
<permission>
<permission-group>
<uses-permission>
<permission-tree>
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# <permission-tree\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cpermission-tree android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n: Declares the base name for a tree of permissions. The application takes\n ownership of all names within the tree. It can dynamically add new permissions\n to the tree by calling [PackageManager.addPermission()](/reference/android/content/pm/PackageManager#addPermission(android.content.pm.PermissionInfo)).\n Names within the tree are separated by\n periods ('`.`'). For example, if the base name is\n `com.example.project.taxes`, permissions like the following might be\n added:\n\n `com.example.project.taxes.CALCULATE`\n\n `com.example.project.taxes.deductions.STORE_RECEIPTS`\n\n `com.example.project.taxes.deductions.ACCESS_RECORDS`\n\n\n This element doesn't declare a permission itself, only a\n namespace in which permissions can be placed. For more information about declaring permissions, see the\n [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n element.\n\nattributes:\n:\n\n `android:icon`\n : An icon representing all the permissions in the tree. This attribute\n must be set as a reference to a drawable resource containing the image\n definition.\n\n `android:label`\n : A user-readable name for the group. As a convenience, the label\n can be directly set as a raw string during development. However,\n when the application is ready to be published, set it as a\n reference to a string resource, so that it can be localized like other\n strings in the user interface.\n\n `android:name`\n : The name at the base of the permission tree. It serves as\n a prefix to all permission names in the tree. Use Java-style scoping\n so that the name is unique. The name must have more than\n two period-separated segments in its path. For example,\n `com.example.base` is OK, but `com.example` isn't.\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n\n [\u003cpermission-group\u003e](/guide/topics/manifest/permission-group-element)\n\n [\u003cuses-permission\u003e](/guide/topics/manifest/uses-permission-element)"]]