【翻译】(57)permission元素
see
http://developer.android.com/guide/topics/manifest/permission-element.html
原文见
http://developer.android.com/guide/topics/manifest/permission-element.html
-------------------------------
<permission>
permission元素
-------------------------------
* syntax:
* 语法:
-------------------------------
<permission android:description="string resource"
android:icon="drawable resource"
android:label="string resource"
android:name="string"
android:permissionGroup="string"
android:protectionLevel=["normal" | "dangerous" |
"signature" | "signatureOrSystem"] />
-------------------------------
* contained in:
* 被包含在:
<manifest>
* description:
* 描述:
Declares a security permission that can be used to limit access to specific components or features of this or other applications. See the Permissions section in the introduction, and the Security and Permissions document for more information on how permissions work.
声明一个安全权限,它被用于限制对特定组件或者这个或其它应用程序的特性的访问。参见介绍中的权限章节,以及安全和权限文档以获得关于权限如何工作的更多信息。
* attributes:
* 属性:
* android:description
A user-readable description of the permission, longer and more informative than the label. It may be displayed to explain the permission to the user — for example, when the user is asked whether to grant the permission to another application.
权限的用户可读描述。比标签更长和带更多信息。它可能被显示以向用户解释权限——例如,当用户被询问是否授权权限给另一个应用程序时。
This attribute must be set as a reference to a string resource; unlike the label attribute, it cannot be a raw string.
这个属性必须被设置为指向字符串的引用;不像label属性那样,它不允许是原始字符串。
* android:icon
A reference to a drawable resource for an icon that represents the permission.
指向可绘画对象资源的引用,用于代表权限的图标。
* android:label
A name for the permission, one that can be displayed to users.
用于权限的名称,它可以被显示给用户。
As a convenience, the label can be directly set as a raw string while you're developing the application. However, when the application is ready to be published, it should be set as a reference to a string resource, so that it can be localized like other strings in the user interface.
作为一种便利,当你正在开发应用程序时标签可以被直接设置作为一个原始字符串。然而,当应用程序准备被发布,它应该被设置为指向字符串资源的引用,使它可以像用户界面中的其它字符串那样被本地化。
* android:name
The name of the permission. This is the name that will be used in code to refer to the permission — for example, in a <uses-permission> element and the permission attributes of application components.
权限的名称。这是将在代码中使用以引用权限的名称——例如,在一个<uses-permission>元素和application组件中的permission属性里。
The name must be unique, so it should use Java-style scoping — for example, "com.example.project.PERMITTED_ACTION".
该名称必须是唯一的,所以它应该使用Java风格作用域——例如,"com.example.project.PERMITTED_ACTION"。
* android:permissionGroup
Assigns this permission to a group. The value of this attribute is the name of the group, which must be declared with the <permission-group> element in this or another application. If this attribute is not set, the permission does not belong to a group.
赋予这个权限给一个组。这个属性的值是组的名称,那个组必须在这个或另一个应用程序中用<permission-group>元素来声明。如果这个属性没有被设置,那么该权限不属于一个组。
* android:protectionLevel
Characterizes the potential risk implied in the permission and indicates the procedure the system should follow when determining whether or not to grant the permission to an application requesting it. The value can be set to one of the following strings:
特征化在权限中暗示的潜在风险,以及当决定是否授权权限给请求它的应用程序时指出系统应该遵循的过程。该值可以被设置为以下字符串之一:
-------------------------------
* Value Meaning
* 值 意思
* "normal" The default value. A lower-risk permission that gives requesting applications access to isolated application-level features, with minimal risk to other applications, the system, or the user. The system automatically grants this type of permission to a requesting application at installation, without asking for the user's explicit approval (though the user always has the option to review these permissions before installing).
* "normal" 默认值。一个低风险权限,它给予请求的应用程序对单独的应用程序层特性的访问权,带有对其它应用程序、系统,或用户最小的风险。系统在安装期自动授权此类权限给请求的应用程序,不征求用户的显式准许(虽然用户总是有选项在安装前回顾这些权限)。
* "dangerous" A higher-risk permission that would give a requesting application access to private user data or control over the device that can negatively impact the user. Because this type of permission introduces potential risk, the system may not automatically grant it to the requesting application. For example, any dangerous permissions requested by an application may be displayed to the user and require confirmation before proceeding, or some other approach may be taken to avoid the user automatically allowing the use of such facilities.
* "dangerous" 一个较高风险的权限,它将给予请求的应用程序对私有用户数据的访问权或可以负面冲击用户的设备上的控制权。因为此类权限引入潜在的风险,系统可能不会自动地授权它给请求的应用程序。例如,被应用程序请求的任意危险权限可能被显示给用户并且在继续前进之前需要确定,或者可能带有其它一些方法以避免用户自动地允许这些设施的使用。
* "signature" A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.
* "signature" 一种权限,仅当请求的应用程序签有和声明该权限的应用程序相同的证书时系统才授权它。如果证书匹配,那么系统自动地授权该权限而不会通知用户或征求用户的显式准许。
* "signatureOrSystem" A permission that the system grants only to applications that are in the Android system image or that are signed with the same certificates as those in the system image. Please avoid using this option, as the signature protection level should be sufficient for most needs and works regardless of exactly where applications are installed. The "signatureOrSystem" permission is used for certain special situations where multiple vendors have applications built into a system image and need to share specific features explicitly because they are being built together.
* "signatureOrSystem",一种权限,系统只把它授权给在Android系统镜像中或签有和系统镜像中应用程序相同证书的应用程序。请避免使用这个选项,因为签名保护级别应该满足大多数需要并且不管应用程序安装在确切的哪个地方都能工作。"signatureOrSystem"权限被用于某些特殊的情况,多个提供商拥有内建进一个系统镜像的应用程序,并且需要显式地共享一些特定的特性,因为它们被构建在一起。
-------------------------------
* introduced in:
* 引入:
API Level 1
API级别1
* see also:
* 另见:
<uses-permission>
<permission-tree>
<permission-group>
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。
Android 4.0 r1 - 10 Feb 2012 0:44
-------------------------------
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)
(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:
* ソフトウェア技術ドキュメントを勝手に翻訳
http://www.techdoctranslator.com/android
* Ley's Blog
http://leybreeze.com/blog/
* 农民伯伯
http://www.cnblogs.com/over140/
* Android中文翻译组
http://androidbox.sinaapp.com/
)