The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2007, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | package android.content.pm; |
| 19 | |
| 20 | import android.content.ComponentName; |
| 21 | import android.content.Intent; |
| 22 | import android.content.IntentFilter; |
| 23 | import android.content.pm.ActivityInfo; |
| 24 | import android.content.pm.ApplicationInfo; |
Anonymous Coward | ceb1b0b | 2012-04-24 10:35:16 -0700 | [diff] [blame] | 25 | import android.content.pm.ContainerEncryptionParams; |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 26 | import android.content.pm.FeatureInfo; |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 27 | import android.content.pm.IPackageInstallObserver2; |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 28 | import android.content.pm.IPackageInstaller; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | import android.content.pm.IPackageDeleteObserver; |
Jeff Sharkey | fbd0e9f | 2014-08-06 16:34:34 -0700 | [diff] [blame] | 30 | import android.content.pm.IPackageDeleteObserver2; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import android.content.pm.IPackageDataObserver; |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 32 | import android.content.pm.IPackageMoveObserver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | import android.content.pm.IPackageStatsObserver; |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame^] | 34 | import android.content.pm.IntentFilterVerificationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.content.pm.InstrumentationInfo; |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 36 | import android.content.pm.KeySet; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | import android.content.pm.PackageInfo; |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 38 | import android.content.pm.ManifestDigest; |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 39 | import android.content.pm.PackageCleanItem; |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 40 | import android.content.pm.ParceledListSlice; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | import android.content.pm.ProviderInfo; |
| 42 | import android.content.pm.PermissionGroupInfo; |
| 43 | import android.content.pm.PermissionInfo; |
| 44 | import android.content.pm.ResolveInfo; |
| 45 | import android.content.pm.ServiceInfo; |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 46 | import android.content.pm.UserInfo; |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 47 | import android.content.pm.VerificationParams; |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 48 | import android.content.pm.VerifierDeviceIdentity; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | import android.net.Uri; |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 50 | import android.os.Bundle; |
Amith Yamasani | b8151ec | 2012-04-18 18:02:48 -0700 | [diff] [blame] | 51 | import android.os.ParcelFileDescriptor; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 52 | import android.content.IntentSender; |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 53 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | |
| 55 | /** |
| 56 | * See {@link PackageManager} for documentation on most of the APIs |
| 57 | * here. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 58 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 59 | * {@hide} |
| 60 | */ |
| 61 | interface IPackageManager { |
Christopher Tate | ba629da | 2013-11-13 17:42:28 -0800 | [diff] [blame] | 62 | boolean isPackageAvailable(String packageName, int userId); |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 63 | PackageInfo getPackageInfo(String packageName, int flags, int userId); |
| 64 | int getPackageUid(String packageName, int userId); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 65 | int[] getPackageGids(String packageName, int userId); |
| 66 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 67 | String[] currentToCanonicalPackageNames(in String[] names); |
| 68 | String[] canonicalToCurrentPackageNames(in String[] names); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | |
| 70 | PermissionInfo getPermissionInfo(String name, int flags); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 71 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | List<PermissionInfo> queryPermissionsByGroup(String group, int flags); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 73 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | PermissionGroupInfo getPermissionGroupInfo(String name, int flags); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 75 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 76 | List<PermissionGroupInfo> getAllPermissionGroups(int flags); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 77 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 78 | ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 79 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 80 | ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 81 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 82 | boolean activitySupportsIntent(in ComponentName className, in Intent intent, |
| 83 | String resolvedType); |
| 84 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 85 | ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 87 | ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 88 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 89 | ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId); |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 90 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 91 | int checkPermission(String permName, String pkgName, int userId); |
| 92 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 93 | int checkUidPermission(String permName, int uid); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 94 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 95 | boolean addPermission(in PermissionInfo info); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 96 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 97 | void removePermission(String name); |
Dianne Hackborn | e639da7 | 2012-02-21 15:11:13 -0800 | [diff] [blame] | 98 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 99 | boolean grantPermission(String packageName, String permissionName, int userId); |
Dianne Hackborn | e639da7 | 2012-02-21 15:11:13 -0800 | [diff] [blame] | 100 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 101 | boolean revokePermission(String packageName, String permissionName, int userId); |
Dianne Hackborn | e639da7 | 2012-02-21 15:11:13 -0800 | [diff] [blame] | 102 | |
Dianne Hackborn | 854060af | 2009-07-09 18:14:31 -0700 | [diff] [blame] | 103 | boolean isProtectedBroadcast(String actionName); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 104 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | int checkSignatures(String pkg1, String pkg2); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 106 | |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 107 | int checkUidSignatures(int uid1, int uid2); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 108 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | String[] getPackagesForUid(int uid); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 110 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | String getNameForUid(int uid); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 112 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 113 | int getUidForSharedUser(String sharedUserName); |
Ben Gruver | dd72c9e | 2013-08-06 12:34:17 -0700 | [diff] [blame] | 114 | |
| 115 | int getFlagsForUid(int uid); |
| 116 | |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 117 | int getPrivateFlagsForUid(int uid); |
| 118 | |
Dianne Hackborn | 2d7576b | 2014-10-03 16:26:04 -0700 | [diff] [blame] | 119 | boolean isUidPrivileged(int uid); |
| 120 | |
Dianne Hackborn | 33f5ddd | 2014-07-21 15:35:45 -0700 | [diff] [blame] | 121 | String[] getAppOpPermissionPackages(String permissionName); |
| 122 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 123 | ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 124 | |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 125 | boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId); |
Nicolas Prevot | 10fa67c | 2014-03-24 13:44:38 +0000 | [diff] [blame] | 126 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 127 | List<ResolveInfo> queryIntentActivities(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 128 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 129 | |
| 130 | List<ResolveInfo> queryIntentActivityOptions( |
| 131 | in ComponentName caller, in Intent[] specifics, |
| 132 | in String[] specificTypes, in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 133 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 134 | |
| 135 | List<ResolveInfo> queryIntentReceivers(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 136 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 137 | |
| 138 | ResolveInfo resolveService(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 139 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | |
| 141 | List<ResolveInfo> queryIntentServices(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 142 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 143 | |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 144 | List<ResolveInfo> queryIntentContentProviders(in Intent intent, |
| 145 | String resolvedType, int flags, int userId); |
| 146 | |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 147 | /** |
| 148 | * This implements getInstalledPackages via a "last returned row" |
| 149 | * mechanism that is not exposed in the API. This is to get around the IPC |
| 150 | * limit that kicks in when flags are included that bloat up the data |
| 151 | * returned. |
| 152 | */ |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 153 | ParceledListSlice getInstalledPackages(int flags, in int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 154 | |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 155 | /** |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 156 | * This implements getPackagesHoldingPermissions via a "last returned row" |
| 157 | * mechanism that is not exposed in the API. This is to get around the IPC |
| 158 | * limit that kicks in when flags are included that bloat up the data |
| 159 | * returned. |
| 160 | */ |
| 161 | ParceledListSlice getPackagesHoldingPermissions(in String[] permissions, |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 162 | int flags, int userId); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 163 | |
| 164 | /** |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 165 | * This implements getInstalledApplications via a "last returned row" |
| 166 | * mechanism that is not exposed in the API. This is to get around the IPC |
| 167 | * limit that kicks in when flags are included that bloat up the data |
| 168 | * returned. |
| 169 | */ |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 170 | ParceledListSlice getInstalledApplications(int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 171 | |
| 172 | /** |
| 173 | * Retrieve all applications that are marked as persistent. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 174 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 175 | * @return A List<applicationInfo> containing one entry for each persistent |
| 176 | * application. |
| 177 | */ |
| 178 | List<ApplicationInfo> getPersistentApplications(int flags); |
| 179 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 180 | ProviderInfo resolveContentProvider(String name, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 181 | |
| 182 | /** |
| 183 | * Retrieve sync information for all content providers. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 184 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 185 | * @param outNames Filled in with a list of the root names of the content |
| 186 | * providers that can sync. |
| 187 | * @param outInfo Filled in with a list of the ProviderInfo for each |
| 188 | * name in 'outNames'. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 189 | */ |
| 190 | void querySyncProviders(inout List<String> outNames, |
| 191 | inout List<ProviderInfo> outInfo); |
| 192 | |
| 193 | List<ProviderInfo> queryContentProviders( |
| 194 | String processName, int uid, int flags); |
| 195 | |
| 196 | InstrumentationInfo getInstrumentationInfo( |
| 197 | in ComponentName className, int flags); |
| 198 | |
| 199 | List<InstrumentationInfo> queryInstrumentation( |
| 200 | String targetPackage, int flags); |
| 201 | |
Jeff Sharkey | 513a074 | 2014-07-08 17:10:32 -0700 | [diff] [blame] | 202 | void installPackage(in String originPath, |
| 203 | in IPackageInstallObserver2 observer, |
| 204 | int flags, |
| 205 | in String installerPackageName, |
| 206 | in VerificationParams verificationParams, |
| 207 | in String packageAbiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 208 | |
Amith Yamasani | dda003f | 2014-08-28 18:06:51 -0700 | [diff] [blame] | 209 | void installPackageAsUser(in String originPath, |
| 210 | in IPackageInstallObserver2 observer, |
| 211 | int flags, |
| 212 | in String installerPackageName, |
| 213 | in VerificationParams verificationParams, |
| 214 | in String packageAbiOverride, |
| 215 | int userId); |
| 216 | |
Christopher Tate | 1bb6906 | 2010-02-19 17:02:12 -0800 | [diff] [blame] | 217 | void finishPackageInstall(int token); |
| 218 | |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 219 | void setInstallerPackageName(in String targetPackage, in String installerPackageName); |
| 220 | |
Jeff Sharkey | fbd0e9f | 2014-08-06 16:34:34 -0700 | [diff] [blame] | 221 | /** @deprecated rawr, don't call AIDL methods directly! */ |
| 222 | void deletePackageAsUser(in String packageName, IPackageDeleteObserver observer, |
| 223 | int userId, int flags); |
| 224 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 225 | /** |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 226 | * Delete a package for a specific user. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 227 | * |
| 228 | * @param packageName The fully qualified name of the package to delete. |
| 229 | * @param observer a callback to use to notify when the package deletion in finished. |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 230 | * @param userId the id of the user for whom to delete the package |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 231 | * @param flags - possible values: {@link #DONT_DELETE_DATA} |
| 232 | */ |
Jeff Sharkey | fbd0e9f | 2014-08-06 16:34:34 -0700 | [diff] [blame] | 233 | void deletePackage(in String packageName, IPackageDeleteObserver2 observer, int userId, int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 234 | |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 235 | String getInstallerPackageName(in String packageName); |
| 236 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 237 | void addPackageToPreferred(String packageName); |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 238 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 239 | void removePackageFromPreferred(String packageName); |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 240 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 241 | List<PackageInfo> getPreferredPackages(int flags); |
| 242 | |
Dianne Hackborn | 8a2ed1d | 2013-01-29 15:18:29 -0800 | [diff] [blame] | 243 | void resetPreferredActivities(int userId); |
| 244 | |
Amith Yamasani | e9ecc8b | 2013-08-22 11:16:27 -0700 | [diff] [blame] | 245 | ResolveInfo getLastChosenActivity(in Intent intent, |
| 246 | String resolvedType, int flags); |
| 247 | |
| 248 | void setLastChosenActivity(in Intent intent, String resolvedType, int flags, |
| 249 | in IntentFilter filter, int match, in ComponentName activity); |
| 250 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 251 | void addPreferredActivity(in IntentFilter filter, int match, |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 252 | in ComponentName[] set, in ComponentName activity, int userId); |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 253 | |
| 254 | void replacePreferredActivity(in IntentFilter filter, int match, |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 255 | in ComponentName[] set, in ComponentName activity, int userId); |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 256 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 257 | void clearPackagePreferredActivities(String packageName); |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 258 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 259 | int getPreferredActivities(out List<IntentFilter> outFilters, |
| 260 | out List<ComponentName> outActivities, String packageName); |
Amith Yamasani | e9ecc8b | 2013-08-22 11:16:27 -0700 | [diff] [blame] | 261 | |
Sander Alewijnse | f475ca3 | 2014-02-17 15:13:58 +0000 | [diff] [blame] | 262 | void addPersistentPreferredActivity(in IntentFilter filter, in ComponentName activity, int userId); |
| 263 | |
| 264 | void clearPackagePersistentPreferredActivities(String packageName, int userId); |
| 265 | |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 266 | void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage, |
Nicolas Prevot | 4b8d582 | 2015-03-05 15:20:49 +0000 | [diff] [blame] | 267 | int sourceUserId, int targetUserId, int flags); |
Nicolas Prevot | 10fa67c | 2014-03-24 13:44:38 +0000 | [diff] [blame] | 268 | |
Nicolas Prevot | 4b8d582 | 2015-03-05 15:20:49 +0000 | [diff] [blame] | 269 | void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage); |
Nicolas Prevot | 10fa67c | 2014-03-24 13:44:38 +0000 | [diff] [blame] | 270 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 271 | /** |
Christopher Tate | a2a0850d | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 272 | * Report the set of 'Home' activity candidates, plus (if any) which of them |
| 273 | * is the current "always use this one" setting. |
| 274 | */ |
| 275 | ComponentName getHomeActivities(out List<ResolveInfo> outHomeCandidates); |
| 276 | |
| 277 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 278 | * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}. |
| 279 | */ |
| 280 | void setComponentEnabledSetting(in ComponentName componentName, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 281 | in int newState, in int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 282 | |
| 283 | /** |
| 284 | * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}. |
| 285 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 286 | int getComponentEnabledSetting(in ComponentName componentName, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 287 | |
| 288 | /** |
| 289 | * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}. |
| 290 | */ |
Dianne Hackborn | 3fa3c28a | 2013-03-26 16:15:41 -0700 | [diff] [blame] | 291 | void setApplicationEnabledSetting(in String packageName, in int newState, int flags, |
| 292 | int userId, String callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 293 | |
| 294 | /** |
| 295 | * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}. |
| 296 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 297 | int getApplicationEnabledSetting(in String packageName, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 298 | |
| 299 | /** |
Dianne Hackborn | e7f9721 | 2011-02-24 14:40:20 -0800 | [diff] [blame] | 300 | * Set whether the given package should be considered stopped, making |
| 301 | * it not visible to implicit intents that filter out stopped packages. |
| 302 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 303 | void setPackageStoppedState(String packageName, boolean stopped, int userId); |
Dianne Hackborn | e7f9721 | 2011-02-24 14:40:20 -0800 | [diff] [blame] | 304 | |
| 305 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 306 | * Free storage by deleting LRU sorted list of cache files across |
| 307 | * all applications. If the currently available free storage |
| 308 | * on the device is greater than or equal to the requested |
| 309 | * free storage, no cache files are cleared. If the currently |
| 310 | * available storage on the device is less than the requested |
| 311 | * free storage, some or all of the cache files across |
| 312 | * all applications are deleted (based on last accessed time) |
| 313 | * to increase the free storage space on the device to |
| 314 | * the requested value. There is no guarantee that clearing all |
| 315 | * the cache files from all applications will clear up |
| 316 | * enough storage to achieve the desired value. |
| 317 | * @param freeStorageSize The number of bytes of storage to be |
| 318 | * freed by the system. Say if freeStorageSize is XX, |
| 319 | * and the current free storage is YY, |
| 320 | * if XX is less than YY, just return. if not free XX-YY number |
| 321 | * of bytes if possible. |
| 322 | * @param observer call back used to notify when |
| 323 | * the operation is completed |
| 324 | */ |
| 325 | void freeStorageAndNotify(in long freeStorageSize, |
| 326 | IPackageDataObserver observer); |
| 327 | |
| 328 | /** |
| 329 | * Free storage by deleting LRU sorted list of cache files across |
| 330 | * all applications. If the currently available free storage |
| 331 | * on the device is greater than or equal to the requested |
| 332 | * free storage, no cache files are cleared. If the currently |
| 333 | * available storage on the device is less than the requested |
| 334 | * free storage, some or all of the cache files across |
| 335 | * all applications are deleted (based on last accessed time) |
| 336 | * to increase the free storage space on the device to |
| 337 | * the requested value. There is no guarantee that clearing all |
| 338 | * the cache files from all applications will clear up |
| 339 | * enough storage to achieve the desired value. |
| 340 | * @param freeStorageSize The number of bytes of storage to be |
| 341 | * freed by the system. Say if freeStorageSize is XX, |
| 342 | * and the current free storage is YY, |
| 343 | * if XX is less than YY, just return. if not free XX-YY number |
| 344 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 345 | * @param pi IntentSender call back used to |
| 346 | * notify when the operation is completed.May be null |
| 347 | * to indicate that no call back is desired. |
| 348 | */ |
Suchi Amalapurapu | bc806f6 | 2009-06-17 15:18:19 -0700 | [diff] [blame] | 349 | void freeStorage(in long freeStorageSize, |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 350 | in IntentSender pi); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 351 | |
| 352 | /** |
| 353 | * Delete all the cache files in an applications cache directory |
| 354 | * @param packageName The package name of the application whose cache |
| 355 | * files need to be deleted |
| 356 | * @param observer a callback used to notify when the deletion is finished. |
| 357 | */ |
| 358 | void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer); |
| 359 | |
| 360 | /** |
| 361 | * Clear the user data directory of an application. |
| 362 | * @param packageName The package name of the application whose cache |
| 363 | * files need to be deleted |
| 364 | * @param observer a callback used to notify when the operation is completed. |
| 365 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 366 | void clearApplicationUserData(in String packageName, IPackageDataObserver observer, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 367 | |
| 368 | /** |
| 369 | * Get package statistics including the code, data and cache size for |
| 370 | * an already installed package |
| 371 | * @param packageName The package name of the application |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 372 | * @param userHandle Which user the size should be retrieved for |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 373 | * @param observer a callback to use to notify when the asynchronous |
| 374 | * retrieval of information is complete. |
| 375 | */ |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 376 | void getPackageSizeInfo(in String packageName, int userHandle, IPackageStatsObserver observer); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 377 | |
| 378 | /** |
| 379 | * Get a list of shared libraries that are available on the |
| 380 | * system. |
| 381 | */ |
| 382 | String[] getSystemSharedLibraryNames(); |
| 383 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 384 | /** |
| 385 | * Get a list of features that are available on the |
| 386 | * system. |
| 387 | */ |
| 388 | FeatureInfo[] getSystemAvailableFeatures(); |
| 389 | |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 390 | boolean hasSystemFeature(String name); |
| 391 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 392 | void enterSafeMode(); |
| 393 | boolean isSafeMode(); |
| 394 | void systemReady(); |
| 395 | boolean hasSystemUidErrors(); |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 396 | |
| 397 | /** |
| 398 | * Ask the package manager to perform boot-time dex-opt of all |
| 399 | * existing packages. |
| 400 | */ |
| 401 | void performBootDexOpt(); |
| 402 | |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 403 | /** |
| 404 | * Ask the package manager to perform dex-opt (if needed) on the given |
Narayan Kamath | 2053168 | 2014-07-14 13:18:43 +0100 | [diff] [blame] | 405 | * package and for the given instruction set if it already hasn't done |
| 406 | * so. |
| 407 | * |
| 408 | * If the supplied instructionSet is null, the package manager will use |
| 409 | * the packages default instruction set. |
| 410 | * |
| 411 | * In most cases, apps are dexopted in advance and this function will |
| 412 | * be a no-op. |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 413 | */ |
Narayan Kamath | 2053168 | 2014-07-14 13:18:43 +0100 | [diff] [blame] | 414 | boolean performDexOptIfNeeded(String packageName, String instructionSet); |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 415 | |
Jeff Sharkey | 20e0c50 | 2014-07-25 14:09:37 -0700 | [diff] [blame] | 416 | void forceDexOpt(String packageName); |
| 417 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 418 | /** |
| 419 | * Update status of external media on the package manager to scan and |
| 420 | * install packages installed on the external media. Like say the |
| 421 | * MountService uses this to call into the package manager to update |
| 422 | * status of sdcard. |
| 423 | */ |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 424 | void updateExternalMediaStatus(boolean mounted, boolean reportStatus); |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 425 | |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 426 | PackageCleanItem nextPackageToClean(in PackageCleanItem lastPackage); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 427 | |
| 428 | void movePackage(String packageName, IPackageMoveObserver observer, int flags); |
Rich Cannings | e1d7c71 | 2012-08-08 12:46:06 -0700 | [diff] [blame] | 429 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 430 | boolean addPermissionAsync(in PermissionInfo info); |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 431 | |
| 432 | boolean setInstallLocation(int loc); |
| 433 | int getInstallLocation(); |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 434 | |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 435 | int installExistingPackageAsUser(String packageName, int userId); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 436 | |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 437 | void verifyPendingInstall(int id, int verificationCode); |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 438 | void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay); |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 439 | |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame^] | 440 | void verifyIntentFilter(int id, int verificationCode, in List<String> outFailedDomains); |
| 441 | int getIntentVerificationStatus(String packageName, int userId); |
| 442 | boolean updateIntentVerificationStatus(String packageName, int status, int userId); |
| 443 | List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName); |
| 444 | |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 445 | VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Dianne Hackborn | 58f42a5 | 2011-10-10 13:46:34 -0700 | [diff] [blame] | 446 | |
| 447 | boolean isFirstBoot(); |
Dianne Hackborn | 13579ed | 2012-11-28 18:05:36 -0800 | [diff] [blame] | 448 | boolean isOnlyCoreApps(); |
Jeff Hao | 9f60c08 | 2014-10-28 18:51:07 -0700 | [diff] [blame] | 449 | boolean isUpgrade(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 450 | |
Jeff Sharkey | 5d32e77 | 2012-04-12 15:59:23 -0700 | [diff] [blame] | 451 | void setPermissionEnforced(String permission, boolean enforced); |
| 452 | boolean isPermissionEnforced(String permission); |
Jeff Sharkey | f6f7f1d | 2012-06-12 17:12:08 -0700 | [diff] [blame] | 453 | |
| 454 | /** Reflects current DeviceStorageMonitorService state */ |
| 455 | boolean isStorageLow(); |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 456 | |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 457 | boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId); |
| 458 | boolean getApplicationHiddenSettingAsUser(String packageName, int userId); |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 459 | |
| 460 | IPackageInstaller getPackageInstaller(); |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 461 | |
| 462 | boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId); |
| 463 | boolean getBlockUninstallForUser(String packageName, int userId); |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 464 | |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 465 | KeySet getKeySetByAlias(String packageName, String alias); |
| 466 | KeySet getSigningKeySet(String packageName); |
| 467 | boolean isPackageSignedByKeySet(String packageName, in KeySet ks); |
| 468 | boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 469 | } |