1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2009 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<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17    package="com.android.cts.permissiondeclareapp">
18
19    <!--
20    An app that declares a permission that requires a matching signature to
21    access.
22    -->
23    <permission android:name="com.android.cts.permissionWithSignature"
24        android:protectionLevel="signature" />
25    <uses-permission android:name="com.android.cts.permissionWithSignature" />
26    <!-- To enable the app to start activities from the background. -->
27    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
28
29    <!-- A permission this app will not hold. -->
30    <permission android:name="com.android.cts.permissionNotUsedWithSignature"
31        android:protectionLevel="signature" />
32
33    <permission android:name="com.android.cts.permissionNormal" />
34
35    <application>
36        <provider android:name="UtilsProvider"
37                android:authorities="com.android.cts.permissiondeclareapp"
38                android:exported="true" />
39
40        <!-- Need a way for another app to try to access the permission. So create a content
41        provider which is enforced by the permission -->
42        <provider android:name="PermissionContentProvider"
43                android:authorities="ctspermissionwithsignature"
44                android:readPermission="com.android.cts.permissionWithSignature"
45                android:writePermission="com.android.cts.permissionWithSignature"
46                android:exported="true">
47        </provider>
48
49        <!-- Need a way for another app to try to access the permission, but will
50             grant uri access. -->
51        <provider android:name="PermissionContentProviderGranting"
52                android:authorities="ctspermissionwithsignaturegranting"
53                android:readPermission="com.android.cts.permissionWithSignature"
54                android:writePermission="com.android.cts.permissionWithSignature"
55                android:exported="true">
56            <grant-uri-permission android:pathPattern="/foo.*" />
57            <grant-uri-permission android:pathPattern="/yes.*" />
58        </provider>
59
60        <!-- Nobody else should get access to this -->
61        <provider android:name="PrivateContentProvider"
62                android:authorities="ctsprivateprovider"
63                android:exported="false">
64        </provider>
65
66        <!-- Nobody else should get access to this, but we will grant uri access -->
67        <provider android:name="PrivateContentProviderGranting"
68                android:authorities="ctsprivateprovidergranting"
69                android:exported="false">
70            <grant-uri-permission android:pathPattern="/foo.*" />
71            <grant-uri-permission android:pathPattern="/yes.*" />
72        </provider>
73
74        <!-- An ambiguous content provider, where "exported" was not specified.
75             Nobody should get access to this. -->
76        <provider android:name="AmbiguousContentProvider"
77                android:authorities="ctsambiguousprovider">
78        </provider>
79
80        <!-- Target for tests about how path permissions interact with granting
81             URI permissions. -->
82        <provider android:name="PermissionContentProviderPath"
83                android:authorities="ctspermissionwithsignaturepath"
84                android:readPermission="com.android.cts.permissionNotUsedWithSignature"
85                android:writePermission="com.android.cts.permissionNotUsedWithSignature"
86                android:exported="true">
87            <path-permission
88                    android:pathPrefix="/foo"
89                    android:readPermission="com.android.cts.permissionWithSignature"
90                    android:writePermission="com.android.cts.permissionWithSignature" />
91            <path-permission
92                    android:pathPrefix="/yes"
93                    android:readPermission="com.android.cts.permissionWithSignature"
94                    android:writePermission="com.android.cts.permissionWithSignature" />
95            <grant-uri-permission android:pathPattern=".*" />
96        </provider>
97
98        <!-- Target for tests that verify path permissions can restrict access
99             when no default top-level permission. -->
100        <provider android:name="PermissionContentProviderPathRestricting"
101                android:authorities="ctspermissionwithsignaturepathrestricting"
102                android:exported="true">
103            <!-- Require signature permission to get into path. -->
104            <path-permission
105                    android:pathPrefix="/foo"
106                    android:readPermission="com.android.cts.permissionWithSignature"
107                    android:writePermission="com.android.cts.permissionWithSignature" />
108            <!-- Allow access to a specific path inside. -->
109            <path-permission
110                    android:pathPrefix="/foo/bar"
111                    android:readPermission="com.android.cts.permissionNormal"
112                    android:writePermission="com.android.cts.permissionNormal" />
113        </provider>
114
115    </application>
116</manifest>
117