1 /* 2 * Copyright (C) 2018 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.app; 18 19 import android.content.pm.ParceledListSlice; 20 import android.net.Uri; 21 import android.os.IBinder; 22 23 /** 24 * Interface for managing an app's permission to access a particular URI. 25 * {@hide} 26 */ 27 interface IUriGrantsManager { 28 void takePersistableUriPermission(in Uri uri, int modeFlags, String toPackage, int userId); 29 void releasePersistableUriPermission(in Uri uri, int modeFlags, String toPackage, int userId); 30 void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg, 31 in Uri uri, int mode, int sourceUserId, int targetUserId); 32 /** 33 * Gets the URI permissions granted to an arbitrary package (or all packages if null) 34 * NOTE: this is different from getUriPermissions(), which returns the URIs the package 35 * granted to another packages (instead of those granted to it). 36 */ 37 ParceledListSlice getGrantedUriPermissions(in String packageName, int userId); 38 /** Clears the URI permissions granted to an arbitrary package. */ 39 void clearGrantedUriPermissions(in String packageName, int userId); 40 ParceledListSlice getUriPermissions(in String packageName, boolean incoming, 41 boolean persistedOnly); 42 } 43