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 <!-- To set package installer --> 36 <uses-permission android:name="android.permission.INSTALL_PACKAGES" /> 37 38 <instrumentation 39 android:name="androidx.test.runner.AndroidJUnitRunner" 40 android:targetPackage="com.android.cts.permissiondeclareapp" 41 /> 42 43 <application> 44 <provider android:name="UtilsProvider" 45 android:authorities="com.android.cts.permissiondeclareapp" 46 android:exported="true" /> 47 48 <!-- Need a way for another app to try to access the permission. So create a content 49 provider which is enforced by the permission --> 50 <provider android:name="PermissionContentProvider" 51 android:authorities="ctspermissionwithsignature" 52 android:readPermission="com.android.cts.permissionWithSignature" 53 android:writePermission="com.android.cts.permissionWithSignature" 54 android:exported="true"> 55 </provider> 56 57 <!-- Need a way for another app to try to access the permission, but will 58 grant uri access. --> 59 <provider android:name="PermissionContentProviderGranting" 60 android:authorities="ctspermissionwithsignaturegranting" 61 android:readPermission="com.android.cts.permissionWithSignature" 62 android:writePermission="com.android.cts.permissionWithSignature" 63 android:exported="true"> 64 <grant-uri-permission android:pathPattern="/foo.*" /> 65 <grant-uri-permission android:pathPattern="/yes.*" /> 66 </provider> 67 68 <!-- Nobody else should get access to this --> 69 <provider android:name="PrivateContentProvider" 70 android:authorities="ctsprivateprovider" 71 android:exported="false"> 72 </provider> 73 74 <!-- Nobody else should get access to this, but we will grant uri access --> 75 <provider android:name="PrivateContentProviderGranting" 76 android:authorities="ctsprivateprovidergranting" 77 android:exported="false"> 78 <grant-uri-permission android:pathPattern="/foo.*" /> 79 <grant-uri-permission android:pathPattern="/yes.*" /> 80 </provider> 81 82 <!-- An ambiguous content provider, where "exported" was not specified. 83 Nobody should get access to this. --> 84 <provider android:name="AmbiguousContentProvider" 85 android:authorities="ctsambiguousprovider"> 86 </provider> 87 88 <!-- Target for tests about how path permissions interact with granting 89 URI permissions. --> 90 <provider android:name="PermissionContentProviderPath" 91 android:authorities="ctspermissionwithsignaturepath" 92 android:readPermission="com.android.cts.permissionNotUsedWithSignature" 93 android:writePermission="com.android.cts.permissionNotUsedWithSignature" 94 android:exported="true"> 95 <path-permission 96 android:pathPrefix="/foo" 97 android:readPermission="com.android.cts.permissionWithSignature" 98 android:writePermission="com.android.cts.permissionWithSignature" /> 99 <path-permission 100 android:pathPrefix="/yes" 101 android:readPermission="com.android.cts.permissionWithSignature" 102 android:writePermission="com.android.cts.permissionWithSignature" /> 103 <grant-uri-permission android:pathPattern="/foo.*" /> 104 <grant-uri-permission android:pathPattern="/yes.*" /> 105 </provider> 106 107 <!-- Target for tests that verify path permissions can restrict access 108 when no default top-level permission. --> 109 <provider android:name="PermissionContentProviderPathRestricting" 110 android:authorities="ctspermissionwithsignaturepathrestricting" 111 android:exported="true"> 112 <!-- Require signature permission to get into path. --> 113 <path-permission 114 android:pathPrefix="/foo" 115 android:readPermission="com.android.cts.permissionWithSignature" 116 android:writePermission="com.android.cts.permissionWithSignature" /> 117 <!-- Allow access to a specific path inside. --> 118 <path-permission 119 android:pathPrefix="/foo/bar" 120 android:readPermission="com.android.cts.permissionNormal" 121 android:writePermission="com.android.cts.permissionNormal" /> 122 </provider> 123 124 <activity android:name=".SendResultActivity" android:exported="true" /> 125 </application> 126</manifest> 127