1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright (C) 2019 The Android Open Source Project
3
4         Licensed under the Apache License, Version 2.0 (the "License");
5         you may not use this file except in compliance with the License.
6         You may obtain a copy of the License at
7
8                    http://www.apache.org/licenses/LICENSE-2.0
9
10         Unless required by applicable law or agreed to in writing, software
11         distributed under the License is distributed on an "AS IS" BASIS,
12         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13         See the License for the specific language governing permissions and
14         limitations under the License.
15-->
16<!-- TODO: define a targetNamespace. Note that it will break retrocompatibility -->
17<xs:schema version="2.0"
18           elementFormDefault="qualified"
19           attributeFormDefault="unqualified"
20           xmlns:xs="http://www.w3.org/2001/XMLSchema">
21    <xs:element name="permissions">
22        <xs:complexType>
23            <xs:choice minOccurs="0" maxOccurs="unbounded">
24                <xs:element name="group" type="group"/>
25                <xs:element name="permission" type="permission"/>
26                <xs:element name="assign-permission" type="assign-permission"/>
27                <xs:element name="split-permission" type="split-permission"/>
28                <xs:element name="library" type="library"/>
29                <xs:element name="feature" type="feature"/>
30                <xs:element name="unavailable-feature" type="unavailable-feature"/>
31                <xs:element name="allow-in-power-save-except-idle" type="allow-in-power-save-except-idle"/>
32                <xs:element name="allow-in-power-save" type="allow-in-power-save"/>
33                <xs:element name="allow-in-data-usage-save" type="allow-in-data-usage-save"/>
34                <xs:element name="allow-unthrottled-location" type="allow-unthrottled-location"/>
35                <xs:element name="allow-ignore-location-settings" type="allow-ignore-location-settings"/>
36                <xs:element name="allow-implicit-broadcast" type="allow-implicit-broadcast"/>
37                <xs:element name="app-link" type="app-link"/>
38                <xs:element name="system-user-whitelisted-app" type="system-user-whitelisted-app"/>
39                <xs:element name="system-user-blacklisted-app" type="system-user-blacklisted-app"/>
40                <xs:element name="default-enabled-vr-app" type="default-enabled-vr-app"/>
41                <xs:element name="backup-transport-whitelisted-service" type="backup-transport-whitelisted-service"/>
42                <xs:element name="disabled-until-used-preinstalled-carrier-associated-app" type="disabled-until-used-preinstalled-carrier-associated-app"/>
43                <xs:element name="disabled-until-used-preinstalled-carrier-app" type="disabled-until-used-preinstalled-carrier-app"/>
44                <xs:element name="privapp-permissions" type="privapp-permissions"/>
45                <xs:element name="oem-permissions" type="oem-permissions"/>
46                <xs:element name="hidden-api-whitelisted-app" type="hidden-api-whitelisted-app"/>
47                <xs:element name="allow-association" type="allow-association"/>
48                <xs:element name="bugreport-whitelisted" type="bugreport-whitelisted"/>
49            </xs:choice>
50        </xs:complexType>
51    </xs:element>
52    <xs:complexType name="group">
53        <xs:attribute name="gid" type="xs:int"/>
54    </xs:complexType>
55    <xs:complexType name="permission">
56        <xs:attribute name="name" type="xs:string"/>
57    </xs:complexType>
58    <xs:complexType name="assign-permission">
59        <xs:attribute name="name" type="xs:string"/>
60        <xs:attribute name="uid" type="xs:int"/>
61    </xs:complexType>
62    <xs:complexType name="split-permission">
63        <xs:sequence>
64            <xs:element name="library" maxOccurs="unbounded">
65                <xs:complexType>
66                    <xs:attribute name="name" type="xs:string"/>
67                </xs:complexType>
68            </xs:element>
69        </xs:sequence>
70        <xs:attribute name="name" type="xs:string"/>
71        <xs:attribute name="targetSdk" type="xs:int"/>
72    </xs:complexType>
73    <xs:complexType name="library">
74        <xs:attribute name="name" type="xs:string"/>
75        <xs:attribute name="file" type="xs:string"/>
76        <xs:attribute name="dependency" type="xs:string"/>
77    </xs:complexType>
78    <xs:complexType name="feature">
79        <xs:attribute name="name" type="xs:string"/>
80        <xs:attribute name="notLowRam" type="xs:string"/>
81        <xs:attribute name="version" type="xs:int"/>
82    </xs:complexType>
83    <xs:complexType name="unavailable-feature">
84        <xs:attribute name="name" type="xs:string"/>
85    </xs:complexType>
86    <xs:complexType name="allow-in-power-save-except-idle">
87        <xs:attribute name="package" type="xs:string"/>
88    </xs:complexType>
89    <xs:complexType name="allow-in-power-save">
90        <xs:attribute name="package" type="xs:string"/>
91    </xs:complexType>
92    <xs:complexType name="allow-in-data-usage-save">
93        <xs:attribute name="package" type="xs:string"/>
94    </xs:complexType>
95    <xs:complexType name="allow-unthrottled-location">
96        <xs:attribute name="package" type="xs:string"/>
97    </xs:complexType>
98    <xs:complexType name="allow-ignore-location-settings">
99        <xs:attribute name="package" type="xs:string"/>
100    </xs:complexType>
101    <xs:complexType name="allow-implicit-broadcast">
102        <xs:attribute name="action" type="xs:string"/>
103    </xs:complexType>
104    <xs:complexType name="app-link">
105        <xs:attribute name="package" type="xs:string"/>
106    </xs:complexType>
107    <xs:complexType name="system-user-whitelisted-app">
108        <xs:attribute name="package" type="xs:string"/>
109    </xs:complexType>
110    <xs:complexType name="system-user-blacklisted-app">
111        <xs:attribute name="package" type="xs:string"/>
112    </xs:complexType>
113    <xs:complexType name="default-enabled-vr-app">
114        <xs:attribute name="package" type="xs:string"/>
115        <xs:attribute name="class" type="xs:string"/>
116    </xs:complexType>
117    <xs:complexType name="backup-transport-whitelisted-service">
118        <xs:attribute name="service" type="xs:string"/>
119    </xs:complexType>
120    <xs:complexType name="disabled-until-used-preinstalled-carrier-associated-app">
121        <xs:attribute name="package" type="xs:string"/>
122        <xs:attribute name="carrierAppPackage" type="xs:string"/>
123    </xs:complexType>
124    <xs:complexType name="disabled-until-used-preinstalled-carrier-app">
125        <xs:attribute name="package" type="xs:string"/>
126    </xs:complexType>
127    <xs:complexType name="privapp-permissions">
128        <xs:sequence>
129            <xs:element name="permission" minOccurs="0" maxOccurs="unbounded">
130                <xs:complexType>
131                    <xs:attribute name="name" type="xs:string"/>
132                </xs:complexType>
133            </xs:element>
134            <xs:element name="deny-permission" minOccurs="0" maxOccurs="unbounded">
135                <xs:complexType>
136                    <xs:attribute name="name" type="xs:string"/>
137                </xs:complexType>
138            </xs:element>
139        </xs:sequence>
140        <xs:attribute name="package" type="xs:string"/>
141    </xs:complexType>
142    <xs:complexType name="oem-permissions">
143        <xs:sequence>
144            <xs:element name="permission" minOccurs="0" maxOccurs="unbounded">
145                <xs:complexType>
146                    <xs:attribute name="name" type="xs:string"/>
147                </xs:complexType>
148            </xs:element>
149            <xs:element name="deny-permission" minOccurs="0" maxOccurs="unbounded">
150                <xs:complexType>
151                    <xs:attribute name="name" type="xs:string"/>
152                </xs:complexType>
153            </xs:element>
154        </xs:sequence>
155        <xs:attribute name="package" type="xs:string"/>
156    </xs:complexType>
157    <xs:complexType name="hidden-api-whitelisted-app">
158        <xs:attribute name="package" type="xs:string"/>
159    </xs:complexType>
160    <xs:complexType name="allow-association">
161        <xs:attribute name="target" type="xs:string"/>
162        <xs:attribute name="allowed" type="xs:string"/>
163    </xs:complexType>
164    <xs:complexType name="bugreport-whitelisted">
165        <xs:attribute name="package" type="xs:string"/>
166    </xs:complexType>
167</xs:schema>
168