OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / frameworks / base / docs / html / guide / topics / manifest / permission-tree-element.jd
1 page.title=<permission-tree>
2 @jd:body
3
4 <dl class="xml">
5 <dt>syntax:</dt>
6 <dd><pre class="stx">&lt;permission-tree android:<a href="#icon">icon</a>="<i>drawable resource</i>"
7                  android:<a href="#label">label</a>="<i>string resource</i>" ]
8                  android:<a href="#nm">name</a>="<i>string</i>" /&gt;</pre></dd>
9
10 <dt>contained in:</dt>
11 <dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
12
13 <dt>description:</dt>
14 <dd>Declares the base name for a tree of permissions.  The application takes 
15 ownership of all names within the tree.  It can dynamically add new permissions 
16 to the tree by calling <code>{@link android.content.pm.PackageManager#addPermission PackageManager.addPermission()}</code>.  Names within the tree are separated by
17 periods ('{@code .}').  For example, if the base name is
18 {@code com.example.project.taxes}, permissions like the following might be
19 added:
20
21 <p style="margin-left: 2em">{@code com.example.project.taxes.CALCULATE}
22 <br/>{@code com.example.project.taxes.deductions.MAKE_SOME_UP}
23 <br/>{@code com.example.project.taxes.deductions.EXAGGERATE}</p>
24
25 <p>
26 Note that this element does not declare a permission itself, only a 
27 namespace in which further permissions can be placed.  See the 
28 <code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code> 
29 element for information on declaring permissions.
30
31 <dt>attributes:</dt>
32 <dd><dl class="attr">
33 <dt><a name="icon"></a>{@code android:icon}</dt>
34 <dd>An icon representing all the permissions in the tree.  This attribute 
35 must be set as a reference to a drawable resource containing the image 
36 definition.</dd>
37
38 <dt><a name="label"></a>{@code android:label}</dt>
39 <dd>A user-readable name for the group.  As a convenience, the label can 
40 be directly set as a raw string for quick and dirty programming.  However, 
41 when the application is ready to be published, it should be set as a 
42 reference to a string resource, so that it can be localized like other 
43 strings in the user interface.</dd>
44
45 <dt><a name="nm"></a>{@code android:name}</dt>
46 <dd>The name that's at the base of the permission tree.  It serves as 
47 a prefix to all permission names in the tree.  Java-style scoping should 
48 be used to ensure that the name is unique.  The name must have more than 
49 two period-separated segments in its path &mdash; for example, 
50 {@code com.example.base} is OK, but {@code com.example} is not.</dd>
51
52 </dl></dd>
53
54 <!-- ##api level indication## -->
55 <dt>introduced in:</dt>
56 <dd>API Level 1</dd>
57
58 <dt>see also:</dt>
59 <dd><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code>
60 <br/><code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></code>
61 <br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
62 </dd>
63
64 </dl>