Todd Kennedy | 8f13598 | 2019-07-02 07:35:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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.permission; |
| 18 | |
Todd Kennedy | 1d29b4a | 2019-07-02 14:49:28 -0700 | [diff] [blame] | 19 | import android.content.pm.ParceledListSlice; |
| 20 | import android.content.pm.PermissionGroupInfo; |
| 21 | import android.content.pm.PermissionInfo; |
Anthony Hugh | de787d4 | 2019-08-22 15:35:48 -0700 | [diff] [blame] | 22 | import android.content.pm.permission.SplitPermissionInfoParcelable; |
Evan Severson | b252d8b | 2019-11-20 08:41:33 -0800 | [diff] [blame] | 23 | import android.os.UserHandle; |
Todd Kennedy | 7e3dd3a | 2019-07-08 10:34:29 -0700 | [diff] [blame] | 24 | import android.permission.IOnPermissionsChangeListener; |
Todd Kennedy | 1d29b4a | 2019-07-02 14:49:28 -0700 | [diff] [blame] | 25 | |
Todd Kennedy | 8f13598 | 2019-07-02 07:35:15 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Interface to communicate directly with the permission manager service. |
| 28 | * @see PermissionManager |
| 29 | * @hide |
| 30 | */ |
| 31 | interface IPermissionManager { |
| 32 | String[] getAppOpPermissionPackages(String permName); |
Todd Kennedy | 1d29b4a | 2019-07-02 14:49:28 -0700 | [diff] [blame] | 33 | |
| 34 | ParceledListSlice getAllPermissionGroups(int flags); |
| 35 | |
| 36 | PermissionGroupInfo getPermissionGroupInfo(String groupName, int flags); |
| 37 | |
| 38 | PermissionInfo getPermissionInfo(String permName, String packageName, int flags); |
| 39 | |
| 40 | ParceledListSlice queryPermissionsByGroup(String groupName, int flags); |
Todd Kennedy | 6ffc5a6 | 2019-07-03 09:35:31 -0700 | [diff] [blame] | 41 | |
| 42 | boolean addPermission(in PermissionInfo info, boolean async); |
| 43 | |
| 44 | void removePermission(String name); |
Todd Kennedy | 230c0a7 | 2019-07-03 13:06:35 -0700 | [diff] [blame] | 45 | |
| 46 | int getPermissionFlags(String permName, String packageName, int userId); |
| 47 | |
| 48 | void updatePermissionFlags(String permName, String packageName, int flagMask, |
| 49 | int flagValues, boolean checkAdjustPolicyFlagPermission, int userId); |
| 50 | |
| 51 | void updatePermissionFlagsForAllApps(int flagMask, int flagValues, int userId); |
Todd Kennedy | ca1ea17 | 2019-07-03 15:02:28 -0700 | [diff] [blame] | 52 | |
| 53 | int checkPermission(String permName, String pkgName, int userId); |
| 54 | |
| 55 | int checkUidPermission(String permName, int uid); |
Todd Kennedy | 7e3dd3a | 2019-07-08 10:34:29 -0700 | [diff] [blame] | 56 | |
Michael Groover | 56a84b2 | 2020-03-04 20:41:36 -0800 | [diff] [blame] | 57 | int checkDeviceIdentifierAccess(String packageName, String callingFeatureId, String message, int pid, int uid); |
| 58 | |
Todd Kennedy | 7e3dd3a | 2019-07-08 10:34:29 -0700 | [diff] [blame] | 59 | void addOnPermissionsChangeListener(in IOnPermissionsChangeListener listener); |
| 60 | |
| 61 | void removeOnPermissionsChangeListener(in IOnPermissionsChangeListener listener); |
| 62 | |
| 63 | List<String> getWhitelistedRestrictedPermissions(String packageName, |
| 64 | int flags, int userId); |
| 65 | |
| 66 | boolean addWhitelistedRestrictedPermission(String packageName, String permName, |
| 67 | int flags, int userId); |
| 68 | |
| 69 | boolean removeWhitelistedRestrictedPermission(String packageName, String permName, |
| 70 | int flags, int userId); |
Todd Kennedy | c971a45 | 2019-07-08 16:04:52 -0700 | [diff] [blame] | 71 | |
| 72 | void grantRuntimePermission(String packageName, String permName, int userId); |
| 73 | |
| 74 | void revokeRuntimePermission(String packageName, String permName, int userId); |
| 75 | |
| 76 | void resetRuntimePermissions(); |
Todd Kennedy | 583378d | 2019-07-12 06:50:30 -0700 | [diff] [blame] | 77 | |
| 78 | boolean setDefaultBrowser(String packageName, int userId); |
| 79 | |
| 80 | String getDefaultBrowser(int userId); |
| 81 | |
| 82 | void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId); |
| 83 | |
| 84 | void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId); |
| 85 | |
| 86 | void grantDefaultPermissionsToEnabledTelephonyDataServices( |
| 87 | in String[] packageNames, int userId); |
| 88 | |
| 89 | void revokeDefaultPermissionsFromDisabledTelephonyDataServices( |
| 90 | in String[] packageNames, int userId); |
| 91 | |
| 92 | void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId); |
| 93 | |
| 94 | void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId); |
Todd Kennedy | c5b0e86 | 2019-07-16 09:47:58 -0700 | [diff] [blame] | 95 | |
| 96 | void setPermissionEnforced(String permName, boolean enforced); |
| 97 | |
| 98 | boolean isPermissionEnforced(String permName); |
| 99 | |
| 100 | boolean shouldShowRequestPermissionRationale(String permName, |
| 101 | String packageName, int userId); |
| 102 | |
| 103 | boolean isPermissionRevokedByPolicy(String permName, String packageName, int userId); |
Anthony Hugh | de787d4 | 2019-08-22 15:35:48 -0700 | [diff] [blame] | 104 | |
| 105 | List<SplitPermissionInfoParcelable> getSplitPermissions(); |
Evan Severson | b252d8b | 2019-11-20 08:41:33 -0800 | [diff] [blame] | 106 | |
| 107 | void startOneTimePermissionSession(String packageName, int userId, long timeout, |
| 108 | int importanceToResetTimer, int importanceToKeepSessionAlive); |
| 109 | |
| 110 | void stopOneTimePermissionSession(String packageName, int userId); |
Eugene Susla | db77bc1 | 2020-03-03 12:09:00 -0800 | [diff] [blame] | 111 | |
| 112 | List<String> getAutoRevokeExemptionRequestedPackages(int userId); |
| 113 | |
| 114 | List<String> getAutoRevokeExemptionGrantedPackages(int userId); |
Eugene Susla | 922cd08 | 2020-03-11 12:38:17 -0700 | [diff] [blame] | 115 | |
| 116 | boolean setAutoRevokeWhitelisted(String packageName, boolean whitelisted, int userId); |
| 117 | |
| 118 | boolean isAutoRevokeWhitelisted(String packageName, int userId); |
Todd Kennedy | 8f13598 | 2019-07-02 07:35:15 -0700 | [diff] [blame] | 119 | } |