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; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | import android.content.pm.IPackageInstallObserver; |
| 28 | import android.content.pm.IPackageDeleteObserver; |
| 29 | import android.content.pm.IPackageDataObserver; |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 30 | import android.content.pm.IPackageMoveObserver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import android.content.pm.IPackageStatsObserver; |
| 32 | import android.content.pm.InstrumentationInfo; |
| 33 | import android.content.pm.PackageInfo; |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 34 | import android.content.pm.ManifestDigest; |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 35 | import android.content.pm.PackageCleanItem; |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 36 | import android.content.pm.ParceledListSlice; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | import android.content.pm.ProviderInfo; |
| 38 | import android.content.pm.PermissionGroupInfo; |
| 39 | import android.content.pm.PermissionInfo; |
| 40 | import android.content.pm.ResolveInfo; |
| 41 | import android.content.pm.ServiceInfo; |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 42 | import android.content.pm.UserInfo; |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 43 | import android.content.pm.VerificationParams; |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 44 | import android.content.pm.VerifierDeviceIdentity; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | import android.net.Uri; |
Amith Yamasani | b8151ec | 2012-04-18 18:02:48 -0700 | [diff] [blame] | 46 | import android.os.ParcelFileDescriptor; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 47 | import android.content.IntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * See {@link PackageManager} for documentation on most of the APIs |
| 51 | * here. |
| 52 | * |
| 53 | * {@hide} |
| 54 | */ |
| 55 | interface IPackageManager { |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 56 | PackageInfo getPackageInfo(String packageName, int flags, int userId); |
| 57 | int getPackageUid(String packageName, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | int[] getPackageGids(String packageName); |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 59 | |
| 60 | String[] currentToCanonicalPackageNames(in String[] names); |
| 61 | String[] canonicalToCurrentPackageNames(in String[] names); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | |
| 63 | PermissionInfo getPermissionInfo(String name, int flags); |
| 64 | |
| 65 | List<PermissionInfo> queryPermissionsByGroup(String group, int flags); |
| 66 | |
| 67 | PermissionGroupInfo getPermissionGroupInfo(String name, int flags); |
| 68 | |
| 69 | List<PermissionGroupInfo> getAllPermissionGroups(int flags); |
| 70 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 71 | ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 73 | ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 75 | ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 76 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 77 | ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 79 | ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId); |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 80 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 81 | int checkPermission(String permName, String pkgName); |
| 82 | |
| 83 | int checkUidPermission(String permName, int uid); |
| 84 | |
| 85 | boolean addPermission(in PermissionInfo info); |
| 86 | |
| 87 | void removePermission(String name); |
Dianne Hackborn | e639da7 | 2012-02-21 15:11:13 -0800 | [diff] [blame] | 88 | |
| 89 | void grantPermission(String packageName, String permissionName); |
| 90 | |
| 91 | void revokePermission(String packageName, String permissionName); |
| 92 | |
Dianne Hackborn | 854060af | 2009-07-09 18:14:31 -0700 | [diff] [blame] | 93 | boolean isProtectedBroadcast(String actionName); |
| 94 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 95 | int checkSignatures(String pkg1, String pkg2); |
| 96 | |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 97 | int checkUidSignatures(int uid1, int uid2); |
| 98 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 | String[] getPackagesForUid(int uid); |
| 100 | |
| 101 | String getNameForUid(int uid); |
| 102 | |
| 103 | int getUidForSharedUser(String sharedUserName); |
Ben Gruver | dd72c9e | 2013-08-06 12:34:17 -0700 | [diff] [blame] | 104 | |
| 105 | int getFlagsForUid(int uid); |
| 106 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 107 | 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] | 108 | |
| 109 | List<ResolveInfo> queryIntentActivities(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 110 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | |
| 112 | List<ResolveInfo> queryIntentActivityOptions( |
| 113 | in ComponentName caller, in Intent[] specifics, |
| 114 | in String[] specificTypes, in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 115 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | |
| 117 | List<ResolveInfo> queryIntentReceivers(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 118 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | |
| 120 | ResolveInfo resolveService(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 121 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | |
| 123 | List<ResolveInfo> queryIntentServices(in Intent intent, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 124 | String resolvedType, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 125 | |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 126 | /** |
| 127 | * This implements getInstalledPackages via a "last returned row" |
| 128 | * mechanism that is not exposed in the API. This is to get around the IPC |
| 129 | * limit that kicks in when flags are included that bloat up the data |
| 130 | * returned. |
| 131 | */ |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 132 | ParceledListSlice getInstalledPackages(int flags, in int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 133 | |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 134 | /** |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 135 | * This implements getPackagesHoldingPermissions via a "last returned row" |
| 136 | * mechanism that is not exposed in the API. This is to get around the IPC |
| 137 | * limit that kicks in when flags are included that bloat up the data |
| 138 | * returned. |
| 139 | */ |
| 140 | ParceledListSlice getPackagesHoldingPermissions(in String[] permissions, |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 141 | int flags, int userId); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 142 | |
| 143 | /** |
Kenny Root | 0e2c0f3 | 2011-04-15 17:50:10 -0700 | [diff] [blame] | 144 | * This implements getInstalledApplications via a "last returned row" |
| 145 | * mechanism that is not exposed in the API. This is to get around the IPC |
| 146 | * limit that kicks in when flags are included that bloat up the data |
| 147 | * returned. |
| 148 | */ |
Dianne Hackborn | d8e1dbb | 2013-01-17 17:47:37 -0800 | [diff] [blame] | 149 | ParceledListSlice getInstalledApplications(int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 150 | |
| 151 | /** |
| 152 | * Retrieve all applications that are marked as persistent. |
| 153 | * |
| 154 | * @return A List<applicationInfo> containing one entry for each persistent |
| 155 | * application. |
| 156 | */ |
| 157 | List<ApplicationInfo> getPersistentApplications(int flags); |
| 158 | |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 159 | ProviderInfo resolveContentProvider(String name, int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 160 | |
| 161 | /** |
| 162 | * Retrieve sync information for all content providers. |
| 163 | * |
| 164 | * @param outNames Filled in with a list of the root names of the content |
| 165 | * providers that can sync. |
| 166 | * @param outInfo Filled in with a list of the ProviderInfo for each |
| 167 | * name in 'outNames'. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 168 | */ |
| 169 | void querySyncProviders(inout List<String> outNames, |
| 170 | inout List<ProviderInfo> outInfo); |
| 171 | |
| 172 | List<ProviderInfo> queryContentProviders( |
| 173 | String processName, int uid, int flags); |
| 174 | |
| 175 | InstrumentationInfo getInstrumentationInfo( |
| 176 | in ComponentName className, int flags); |
| 177 | |
| 178 | List<InstrumentationInfo> queryInstrumentation( |
| 179 | String targetPackage, int flags); |
| 180 | |
| 181 | /** |
| 182 | * Install a package. |
| 183 | * |
| 184 | * @param packageURI The location of the package file to install. |
| 185 | * @param observer a callback to use to notify when the package installation in finished. |
| 186 | * @param flags - possible values: {@link #FORWARD_LOCK_PACKAGE}, |
| 187 | * {@link #REPLACE_EXISITING_PACKAGE} |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 188 | * @param installerPackageName Optional package name of the application that is performing the |
| 189 | * installation. This identifies which market the package came from. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 190 | */ |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 191 | void installPackage(in Uri packageURI, IPackageInstallObserver observer, int flags, |
| 192 | in String installerPackageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 193 | |
Christopher Tate | 1bb6906 | 2010-02-19 17:02:12 -0800 | [diff] [blame] | 194 | void finishPackageInstall(int token); |
| 195 | |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 196 | void setInstallerPackageName(in String targetPackage, in String installerPackageName); |
| 197 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 198 | /** |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 199 | * Delete a package for a specific user. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 200 | * |
| 201 | * @param packageName The fully qualified name of the package to delete. |
| 202 | * @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] | 203 | * @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] | 204 | * @param flags - possible values: {@link #DONT_DELETE_DATA} |
| 205 | */ |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 206 | void deletePackageAsUser(in String packageName, IPackageDeleteObserver observer, |
| 207 | int userId, int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 208 | |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 209 | String getInstallerPackageName(in String packageName); |
| 210 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 211 | void addPackageToPreferred(String packageName); |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 212 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 213 | void removePackageFromPreferred(String packageName); |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 214 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 215 | List<PackageInfo> getPreferredPackages(int flags); |
| 216 | |
Dianne Hackborn | 8a2ed1d | 2013-01-29 15:18:29 -0800 | [diff] [blame] | 217 | void resetPreferredActivities(int userId); |
| 218 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 219 | void addPreferredActivity(in IntentFilter filter, int match, |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 220 | in ComponentName[] set, in ComponentName activity, int userId); |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 221 | |
| 222 | void replacePreferredActivity(in IntentFilter filter, int match, |
| 223 | in ComponentName[] set, in ComponentName activity); |
| 224 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 225 | void clearPackagePreferredActivities(String packageName); |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 226 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 227 | int getPreferredActivities(out List<IntentFilter> outFilters, |
| 228 | out List<ComponentName> outActivities, String packageName); |
| 229 | |
| 230 | /** |
| 231 | * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}. |
| 232 | */ |
| 233 | void setComponentEnabledSetting(in ComponentName componentName, |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 234 | in int newState, in int flags, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 235 | |
| 236 | /** |
| 237 | * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}. |
| 238 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 239 | int getComponentEnabledSetting(in ComponentName componentName, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 240 | |
| 241 | /** |
| 242 | * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}. |
| 243 | */ |
Dianne Hackborn | 3fa3c28a | 2013-03-26 16:15:41 -0700 | [diff] [blame] | 244 | void setApplicationEnabledSetting(in String packageName, in int newState, int flags, |
| 245 | int userId, String callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 246 | |
| 247 | /** |
| 248 | * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}. |
| 249 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 250 | int getApplicationEnabledSetting(in String packageName, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 251 | |
| 252 | /** |
Dianne Hackborn | e7f9721 | 2011-02-24 14:40:20 -0800 | [diff] [blame] | 253 | * Set whether the given package should be considered stopped, making |
| 254 | * it not visible to implicit intents that filter out stopped packages. |
| 255 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 256 | void setPackageStoppedState(String packageName, boolean stopped, int userId); |
Dianne Hackborn | e7f9721 | 2011-02-24 14:40:20 -0800 | [diff] [blame] | 257 | |
| 258 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 259 | * Free storage by deleting LRU sorted list of cache files across |
| 260 | * all applications. If the currently available free storage |
| 261 | * on the device is greater than or equal to the requested |
| 262 | * free storage, no cache files are cleared. If the currently |
| 263 | * available storage on the device is less than the requested |
| 264 | * free storage, some or all of the cache files across |
| 265 | * all applications are deleted (based on last accessed time) |
| 266 | * to increase the free storage space on the device to |
| 267 | * the requested value. There is no guarantee that clearing all |
| 268 | * the cache files from all applications will clear up |
| 269 | * enough storage to achieve the desired value. |
| 270 | * @param freeStorageSize The number of bytes of storage to be |
| 271 | * freed by the system. Say if freeStorageSize is XX, |
| 272 | * and the current free storage is YY, |
| 273 | * if XX is less than YY, just return. if not free XX-YY number |
| 274 | * of bytes if possible. |
| 275 | * @param observer call back used to notify when |
| 276 | * the operation is completed |
| 277 | */ |
| 278 | void freeStorageAndNotify(in long freeStorageSize, |
| 279 | IPackageDataObserver observer); |
| 280 | |
| 281 | /** |
| 282 | * Free storage by deleting LRU sorted list of cache files across |
| 283 | * all applications. If the currently available free storage |
| 284 | * on the device is greater than or equal to the requested |
| 285 | * free storage, no cache files are cleared. If the currently |
| 286 | * available storage on the device is less than the requested |
| 287 | * free storage, some or all of the cache files across |
| 288 | * all applications are deleted (based on last accessed time) |
| 289 | * to increase the free storage space on the device to |
| 290 | * the requested value. There is no guarantee that clearing all |
| 291 | * the cache files from all applications will clear up |
| 292 | * enough storage to achieve the desired value. |
| 293 | * @param freeStorageSize The number of bytes of storage to be |
| 294 | * freed by the system. Say if freeStorageSize is XX, |
| 295 | * and the current free storage is YY, |
| 296 | * if XX is less than YY, just return. if not free XX-YY number |
| 297 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 298 | * @param pi IntentSender call back used to |
| 299 | * notify when the operation is completed.May be null |
| 300 | * to indicate that no call back is desired. |
| 301 | */ |
Suchi Amalapurapu | bc806f6 | 2009-06-17 15:18:19 -0700 | [diff] [blame] | 302 | void freeStorage(in long freeStorageSize, |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 303 | in IntentSender pi); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 304 | |
| 305 | /** |
| 306 | * Delete all the cache files in an applications cache directory |
| 307 | * @param packageName The package name of the application whose cache |
| 308 | * files need to be deleted |
| 309 | * @param observer a callback used to notify when the deletion is finished. |
| 310 | */ |
| 311 | void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer); |
| 312 | |
| 313 | /** |
| 314 | * Clear the user data directory of an application. |
| 315 | * @param packageName The package name of the application whose cache |
| 316 | * files need to be deleted |
| 317 | * @param observer a callback used to notify when the operation is completed. |
| 318 | */ |
Amith Yamasani | 483f3b0 | 2012-03-13 16:08:00 -0700 | [diff] [blame] | 319 | void clearApplicationUserData(in String packageName, IPackageDataObserver observer, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 320 | |
| 321 | /** |
| 322 | * Get package statistics including the code, data and cache size for |
| 323 | * an already installed package |
| 324 | * @param packageName The package name of the application |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 325 | * @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] | 326 | * @param observer a callback to use to notify when the asynchronous |
| 327 | * retrieval of information is complete. |
| 328 | */ |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 329 | void getPackageSizeInfo(in String packageName, int userHandle, IPackageStatsObserver observer); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 330 | |
| 331 | /** |
| 332 | * Get a list of shared libraries that are available on the |
| 333 | * system. |
| 334 | */ |
| 335 | String[] getSystemSharedLibraryNames(); |
| 336 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 337 | /** |
| 338 | * Get a list of features that are available on the |
| 339 | * system. |
| 340 | */ |
| 341 | FeatureInfo[] getSystemAvailableFeatures(); |
| 342 | |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 343 | boolean hasSystemFeature(String name); |
| 344 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 345 | void enterSafeMode(); |
| 346 | boolean isSafeMode(); |
| 347 | void systemReady(); |
| 348 | boolean hasSystemUidErrors(); |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 349 | |
| 350 | /** |
| 351 | * Ask the package manager to perform boot-time dex-opt of all |
| 352 | * existing packages. |
| 353 | */ |
| 354 | void performBootDexOpt(); |
| 355 | |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 356 | /** |
| 357 | * Ask the package manager to perform dex-opt (if needed) on the given |
| 358 | * package, if it already hasn't done mode. Only does this if running |
| 359 | * in the special development "no pre-dexopt" mode. |
| 360 | */ |
| 361 | boolean performDexOpt(String packageName); |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 362 | |
| 363 | /** |
| 364 | * Update status of external media on the package manager to scan and |
| 365 | * install packages installed on the external media. Like say the |
| 366 | * MountService uses this to call into the package manager to update |
| 367 | * status of sdcard. |
| 368 | */ |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 369 | void updateExternalMediaStatus(boolean mounted, boolean reportStatus); |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 370 | |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 371 | PackageCleanItem nextPackageToClean(in PackageCleanItem lastPackage); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 372 | |
| 373 | void movePackage(String packageName, IPackageMoveObserver observer, int flags); |
Rich Cannings | e1d7c71 | 2012-08-08 12:46:06 -0700 | [diff] [blame] | 374 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 375 | boolean addPermissionAsync(in PermissionInfo info); |
Suchi Amalapurapu | 40e4725 | 2010-04-07 16:15:50 -0700 | [diff] [blame] | 376 | |
| 377 | boolean setInstallLocation(int loc); |
| 378 | int getInstallLocation(); |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 379 | |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 380 | void installPackageWithVerification(in Uri packageURI, in IPackageInstallObserver observer, |
| 381 | int flags, in String installerPackageName, in Uri verificationURI, |
Rich Cannings | e1d7c71 | 2012-08-08 12:46:06 -0700 | [diff] [blame] | 382 | in ManifestDigest manifestDigest, in ContainerEncryptionParams encryptionParams); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 383 | |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 384 | void installPackageWithVerificationAndEncryption(in Uri packageURI, |
| 385 | in IPackageInstallObserver observer, int flags, in String installerPackageName, |
| 386 | in VerificationParams verificationParams, |
| 387 | in ContainerEncryptionParams encryptionParams); |
| 388 | |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 389 | int installExistingPackageAsUser(String packageName, int userId); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 390 | |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 391 | void verifyPendingInstall(int id, int verificationCode); |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 392 | void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay); |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 393 | |
| 394 | VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Dianne Hackborn | 58f42a5 | 2011-10-10 13:46:34 -0700 | [diff] [blame] | 395 | |
| 396 | boolean isFirstBoot(); |
Dianne Hackborn | 13579ed | 2012-11-28 18:05:36 -0800 | [diff] [blame] | 397 | boolean isOnlyCoreApps(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 398 | |
Jeff Sharkey | 5d32e77 | 2012-04-12 15:59:23 -0700 | [diff] [blame] | 399 | void setPermissionEnforced(String permission, boolean enforced); |
| 400 | boolean isPermissionEnforced(String permission); |
Jeff Sharkey | f6f7f1d | 2012-06-12 17:12:08 -0700 | [diff] [blame] | 401 | |
| 402 | /** Reflects current DeviceStorageMonitorService state */ |
| 403 | boolean isStorageLow(); |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 404 | |
| 405 | boolean setApplicationBlockedSettingAsUser(String packageName, boolean blocked, int userId); |
| 406 | boolean getApplicationBlockedSettingAsUser(String packageName, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 407 | } |