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         </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             <grant-uri-permission android:pathPattern="/foo.*" />
     54             <grant-uri-permission android:pathPattern="/yes.*" />
     55         </provider>
     56 
     57         <!-- Nobody else should get access to this -->
     58         <provider android:name="PrivateContentProvider"
     59                 android:authorities="ctsprivateprovider"
     60                 android:exported="false">
     61         </provider>
     62 
     63         <!-- Nobody else should get access to this, but we will grant uri access -->
     64         <provider android:name="PrivateContentProviderGranting"
     65                 android:authorities="ctsprivateprovidergranting"
     66                 android:exported="false">
     67             <grant-uri-permission android:pathPattern="/foo.*" />
     68             <grant-uri-permission android:pathPattern="/yes.*" />
     69         </provider>
     70 
     71         <!-- Target for tests about how path permissions interact with granting
     72              URI permissions. -->
     73         <provider android:name="PermissionContentProviderPath"
     74                 android:authorities="ctspermissionwithsignaturepath"
     75                 android:readPermission="com.android.cts.permissionNotUsedWithSignature"
     76                 android:writePermission="com.android.cts.permissionNotUsedWithSignature">
     77             <path-permission
     78                     android:pathPrefix="/foo"
     79                     android:readPermission="com.android.cts.permissionWithSignature"
     80                     android:writePermission="com.android.cts.permissionWithSignature" />
     81             <path-permission
     82                     android:pathPrefix="/yes"
     83                     android:readPermission="com.android.cts.permissionWithSignature"
     84                     android:writePermission="com.android.cts.permissionWithSignature" />
     85             <grant-uri-permission android:pathPattern=".*" />
     86         </provider>
     87 
     88         <!-- Target for tests that verify path permissions can restrict access
     89              when no default top-level permission. -->
     90         <provider android:name="PermissionContentProviderPathRestricting"
     91                 android:authorities="ctspermissionwithsignaturepathrestricting">
     92             <!-- Require signature permission to get into path. -->
     93             <path-permission
     94                     android:pathPrefix="/foo"
     95                     android:readPermission="com.android.cts.permissionWithSignature"
     96                     android:writePermission="com.android.cts.permissionWithSignature" />
     97             <!-- Allow access to a specific path inside. -->
     98             <path-permission
     99                     android:pathPrefix="/foo/bar"
    100                     android:readPermission="com.android.cts.permissionNormal"
    101                     android:writePermission="com.android.cts.permissionNormal" />
    102         </provider>
    103 
    104     </application>
    105 </manifest>
    106