1 /** 2 * Copyright (c) 2024 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 17 package android.content.cts.contenturitestapp; 18 19 import android.net.Uri; 20 21 interface IContentUriTestService { 22 // Constants for #getContentUriForContext 23 const int PKG_ACCESS_TYPE_NONE = 0; 24 const int PKG_ACCESS_TYPE_GRANT = 1; 25 const int PKG_ACCESS_TYPE_GENERAL = 2; 26 const String RECIPIENT = "android.content.cts"; 27 28 // Constants for #getContentUrisForManifest 29 const int URI_NO_PERMISSION_ID = 0; 30 const int URI_READ_PERMISSION_ID = 1; 31 const int URI_WRITE_PERMISSION_ID = 2; 32 const int URI_READ_WRITE_PERMISSION_ID = 3; 33 const int URI_COUNT = 4; 34 35 // Sends a content Uri to the recipient (should be {@link android.content.cts}) for testing 36 // {@link android.content.Context#checkContentUriPermissionFull}. 37 // If pkgAccessType is PKG_ACCESS_TYPE_GRANT, then grants modeFlags permission to the recipient. getContentUriForContext(int pkgAccessType, int modeFlags)38 Uri getContentUriForContext(int pkgAccessType, int modeFlags); 39 40 // Sends an array of content Uris for testing the Activity Manifest attribute 41 // {@link android.R.attr#requireContentUriPermissionFromCaller}. getContentUrisForManifest()42 Uri[] getContentUrisForManifest(); 43 } 44