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