Home | History | Annotate | Download | only in PermissionDeclareApp
      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 
     27     <!-- A permission this app will not hold. -->
     28     <permission android:name="com.android.cts.permissionNotUsedWithSignature"
     29         android:protectionLevel="signature" />
     30 
     31     <permission android:name="com.android.cts.permissionNormal" />
     32 
     33     <application>
     34         <receiver android:name="GrantUriPermission" android:exported="true">
     35         </receiver>
     36         <receiver android:name="SetInstallerPackage" android:exported="true">
     37         </receiver>
     38 
     39         <!-- Need a way for another app to try to access the permission. So create a content
     40         provider which is enforced by the permission -->
     41         <provider android:name="PermissionContentProvider"
     42                 android:authorities="ctspermissionwithsignature"
     43                 android:readPermission="com.android.cts.permissionWithSignature"
     44                 android:writePermission="com.android.cts.permissionWithSignature"
     45                 android:exported="true">
     46         </provider>
     47 
     48         <!-- Need a way for another app to try to access the permission, but will
     49              grant uri access. -->
     50         <provider android:name="PermissionContentProviderGranting"
     51                 android:authorities="ctspermissionwithsignaturegranting"
     52                 android:readPermission="com.android.cts.permissionWithSignature"
     53                 android:writePermission="com.android.cts.permissionWithSignature"
     54                 android:exported="true">
     55             <grant-uri-permission android:pathPattern="/foo.*" />
     56             <grant-uri-permission android:pathPattern="/yes.*" />
     57         </provider>
     58 
     59         <!-- Nobody else should get access to this -->
     60         <provider android:name="PrivateContentProvider"
     61                 android:authorities="ctsprivateprovider"
     62                 android:exported="false">
     63         </provider>
     64 
     65         <!-- Nobody else should get access to this, but we will grant uri access -->
     66         <provider android:name="PrivateContentProviderGranting"
     67                 android:authorities="ctsprivateprovidergranting"
     68                 android:exported="false">
     69             <grant-uri-permission android:pathPattern="/foo.*" />
     70             <grant-uri-permission android:pathPattern="/yes.*" />
     71         </provider>
     72 
     73         <!-- An ambiguous content provider, where "exported" was not specified.
     74              Nobody should get access to this. -->
     75         <provider android:name="AmbiguousContentProvider"
     76                 android:authorities="ctsambiguousprovider">
     77         </provider>
     78 
     79         <!-- Target for tests about how path permissions interact with granting
     80              URI permissions. -->
     81         <provider android:name="PermissionContentProviderPath"
     82                 android:authorities="ctspermissionwithsignaturepath"
     83                 android:readPermission="com.android.cts.permissionNotUsedWithSignature"
     84                 android:writePermission="com.android.cts.permissionNotUsedWithSignature"
     85                 android:exported="true">
     86             <path-permission
     87                     android:pathPrefix="/foo"
     88                     android:readPermission="com.android.cts.permissionWithSignature"
     89                     android:writePermission="com.android.cts.permissionWithSignature" />
     90             <path-permission
     91                     android:pathPrefix="/yes"
     92                     android:readPermission="com.android.cts.permissionWithSignature"
     93                     android:writePermission="com.android.cts.permissionWithSignature" />
     94             <grant-uri-permission android:pathPattern=".*" />
     95         </provider>
     96 
     97         <!-- Target for tests that verify path permissions can restrict access
     98              when no default top-level permission. -->
     99         <provider android:name="PermissionContentProviderPathRestricting"
    100                 android:authorities="ctspermissionwithsignaturepathrestricting"
    101                 android:exported="true">
    102             <!-- Require signature permission to get into path. -->
    103             <path-permission
    104                     android:pathPrefix="/foo"
    105                     android:readPermission="com.android.cts.permissionWithSignature"
    106                     android:writePermission="com.android.cts.permissionWithSignature" />
    107             <!-- Allow access to a specific path inside. -->
    108             <path-permission
    109                     android:pathPrefix="/foo/bar"
    110                     android:readPermission="com.android.cts.permissionNormal"
    111                     android:writePermission="com.android.cts.permissionNormal" />
    112         </provider>
    113 
    114     </application>
    115 </manifest>
    116