blob: c2580c0f41cf266b66e08a19894df05414d190b4 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
18package android.content.pm;
19
20import android.content.ComponentName;
21import android.content.Intent;
22import android.content.IntentFilter;
23import android.content.pm.ActivityInfo;
24import android.content.pm.ApplicationInfo;
Anonymous Cowardceb1b0b2012-04-24 10:35:16 -070025import android.content.pm.ContainerEncryptionParams;
Dianne Hackborn49237342009-08-27 20:08:01 -070026import android.content.pm.FeatureInfo;
Christopher Tatef1977b42014-03-24 16:25:51 -070027import android.content.pm.IPackageInstallObserver2;
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070028import android.content.pm.IPackageInstaller;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.pm.IPackageDeleteObserver;
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -070030import android.content.pm.IPackageDeleteObserver2;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.content.pm.IPackageDataObserver;
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -080032import android.content.pm.IPackageMoveObserver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.pm.IPackageStatsObserver;
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080034import android.content.pm.IntentFilterVerificationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.content.pm.InstrumentationInfo;
dcashmanc6f22492014-08-14 09:54:51 -070036import android.content.pm.KeySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.content.pm.PackageInfo;
Kenny Root5ab21572011-07-27 11:11:19 -070038import android.content.pm.ManifestDigest;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070039import android.content.pm.PackageCleanItem;
Kenny Root0e2c0f32011-04-15 17:50:10 -070040import android.content.pm.ParceledListSlice;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041import android.content.pm.ProviderInfo;
42import android.content.pm.PermissionGroupInfo;
43import android.content.pm.PermissionInfo;
44import android.content.pm.ResolveInfo;
45import android.content.pm.ServiceInfo;
Amith Yamasani0b285492011-04-14 17:35:23 -070046import android.content.pm.UserInfo;
rich cannings706e8ba2012-08-20 13:20:14 -070047import android.content.pm.VerificationParams;
Kenny Root0aaa0d92011-09-12 16:42:55 -070048import android.content.pm.VerifierDeviceIdentity;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049import android.net.Uri;
Svetoslavc6d1c342015-02-26 14:44:43 -080050import android.os.Bundle;
Amith Yamasanib8151ec2012-04-18 18:02:48 -070051import android.os.ParcelFileDescriptor;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070052import android.content.IntentSender;
Svetoslavc6d1c342015-02-26 14:44:43 -080053import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
55/**
56 * See {@link PackageManager} for documentation on most of the APIs
57 * here.
Svetoslavc6d1c342015-02-26 14:44:43 -080058 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059 * {@hide}
60 */
61interface IPackageManager {
Christopher Tateba629da2013-11-13 17:42:28 -080062 boolean isPackageAvailable(String packageName, int userId);
Amith Yamasani483f3b02012-03-13 16:08:00 -070063 PackageInfo getPackageInfo(String packageName, int flags, int userId);
64 int getPackageUid(String packageName, int userId);
Svetoslavc6d1c342015-02-26 14:44:43 -080065 int[] getPackageGids(String packageName, int userId);
66
Dianne Hackborn47096932010-02-11 15:57:09 -080067 String[] currentToCanonicalPackageNames(in String[] names);
68 String[] canonicalToCurrentPackageNames(in String[] names);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069
70 PermissionInfo getPermissionInfo(String name, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080071
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080072 List<PermissionInfo> queryPermissionsByGroup(String group, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080073
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074 PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080075
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080076 List<PermissionGroupInfo> getAllPermissionGroups(int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080077
Amith Yamasani483f3b02012-03-13 16:08:00 -070078 ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080079
Amith Yamasani483f3b02012-03-13 16:08:00 -070080 ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080081
Dianne Hackborn91097de2014-04-04 18:02:06 -070082 boolean activitySupportsIntent(in ComponentName className, in Intent intent,
83 String resolvedType);
84
Amith Yamasani483f3b02012-03-13 16:08:00 -070085 ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080086
Amith Yamasani483f3b02012-03-13 16:08:00 -070087 ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080088
Amith Yamasani483f3b02012-03-13 16:08:00 -070089 ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId);
Dianne Hackborn361199b2010-08-30 17:42:07 -070090
Svetoslavc6d1c342015-02-26 14:44:43 -080091 int checkPermission(String permName, String pkgName, int userId);
92
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 int checkUidPermission(String permName, int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -080094
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 boolean addPermission(in PermissionInfo info);
Svetoslavc6d1c342015-02-26 14:44:43 -080096
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080097 void removePermission(String name);
Dianne Hackborne639da72012-02-21 15:11:13 -080098
Svetoslavc6d1c342015-02-26 14:44:43 -080099 boolean grantPermission(String packageName, String permissionName, int userId);
Dianne Hackborne639da72012-02-21 15:11:13 -0800100
Svetoslavc6d1c342015-02-26 14:44:43 -0800101 boolean revokePermission(String packageName, String permissionName, int userId);
Dianne Hackborne639da72012-02-21 15:11:13 -0800102
Dianne Hackborn854060af2009-07-09 18:14:31 -0700103 boolean isProtectedBroadcast(String actionName);
Svetoslavc6d1c342015-02-26 14:44:43 -0800104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 int checkSignatures(String pkg1, String pkg2);
Svetoslavc6d1c342015-02-26 14:44:43 -0800106
Dianne Hackborn766cbfe2009-08-12 18:33:39 -0700107 int checkUidSignatures(int uid1, int uid2);
Svetoslavc6d1c342015-02-26 14:44:43 -0800108
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800109 String[] getPackagesForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800110
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800111 String getNameForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800112
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800113 int getUidForSharedUser(String sharedUserName);
Ben Gruverdd72c9e2013-08-06 12:34:17 -0700114
115 int getFlagsForUid(int uid);
116
Alex Klyubinb9f8a522015-02-03 11:12:59 -0800117 int getPrivateFlagsForUid(int uid);
118
Dianne Hackborn2d7576b2014-10-03 16:26:04 -0700119 boolean isUidPrivileged(int uid);
120
Dianne Hackborn33f5ddd2014-07-21 15:35:45 -0700121 String[] getAppOpPermissionPackages(String permissionName);
122
Amith Yamasani483f3b02012-03-13 16:08:00 -0700123 ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124
Nicolas Prevot81948992014-05-16 18:25:26 +0100125 boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000126
Svetoslavc6d1c342015-02-26 14:44:43 -0800127 List<ResolveInfo> queryIntentActivities(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700128 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129
130 List<ResolveInfo> queryIntentActivityOptions(
131 in ComponentName caller, in Intent[] specifics,
132 in String[] specificTypes, in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700133 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134
135 List<ResolveInfo> queryIntentReceivers(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700136 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137
138 ResolveInfo resolveService(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700139 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800140
141 List<ResolveInfo> queryIntentServices(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700142 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143
Jeff Sharkey85f5f812013-10-07 10:16:12 -0700144 List<ResolveInfo> queryIntentContentProviders(in Intent intent,
145 String resolvedType, int flags, int userId);
146
Kenny Root0e2c0f32011-04-15 17:50:10 -0700147 /**
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 Hackbornd8e1dbb2013-01-17 17:47:37 -0800153 ParceledListSlice getInstalledPackages(int flags, in int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800154
Kenny Root0e2c0f32011-04-15 17:50:10 -0700155 /**
Dianne Hackborne7991752013-01-16 17:56:46 -0800156 * 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 Hackbornd8e1dbb2013-01-17 17:47:37 -0800162 int flags, int userId);
Dianne Hackborne7991752013-01-16 17:56:46 -0800163
164 /**
Kenny Root0e2c0f32011-04-15 17:50:10 -0700165 * 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 Hackbornd8e1dbb2013-01-17 17:47:37 -0800170 ParceledListSlice getInstalledApplications(int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800171
172 /**
173 * Retrieve all applications that are marked as persistent.
Svetoslavc6d1c342015-02-26 14:44:43 -0800174 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800175 * @return A List&lt;applicationInfo> containing one entry for each persistent
176 * application.
177 */
178 List<ApplicationInfo> getPersistentApplications(int flags);
179
Amith Yamasani483f3b02012-03-13 16:08:00 -0700180 ProviderInfo resolveContentProvider(String name, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800181
182 /**
183 * Retrieve sync information for all content providers.
Svetoslavc6d1c342015-02-26 14:44:43 -0800184 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800185 * @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 Project9066cfe2009-03-03 19:31:44 -0800189 */
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 Sharkey513a0742014-07-08 17:10:32 -0700202 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 Project9066cfe2009-03-03 19:31:44 -0800208
Amith Yamasanidda003f2014-08-28 18:06:51 -0700209 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 Tate1bb69062010-02-19 17:02:12 -0800217 void finishPackageInstall(int token);
218
Dianne Hackborn880119b2010-11-18 22:26:40 -0800219 void setInstallerPackageName(in String targetPackage, in String installerPackageName);
220
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700221 /** @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 Project9066cfe2009-03-03 19:31:44 -0800225 /**
Amith Yamasani67df64b2012-12-14 12:09:36 -0800226 * Delete a package for a specific user.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800227 *
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 Yamasani67df64b2012-12-14 12:09:36 -0800230 * @param userId the id of the user for whom to delete the package
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800231 * @param flags - possible values: {@link #DONT_DELETE_DATA}
232 */
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700233 void deletePackage(in String packageName, IPackageDeleteObserver2 observer, int userId, int flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800234
Jacek Surazski65e13172009-04-28 15:26:38 +0200235 String getInstallerPackageName(in String packageName);
236
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237 void addPackageToPreferred(String packageName);
Amith Yamasani67df64b2012-12-14 12:09:36 -0800238
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800239 void removePackageFromPreferred(String packageName);
Amith Yamasani67df64b2012-12-14 12:09:36 -0800240
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800241 List<PackageInfo> getPreferredPackages(int flags);
242
Dianne Hackborn8a2ed1d2013-01-29 15:18:29 -0800243 void resetPreferredActivities(int userId);
244
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700245 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 Project9066cfe2009-03-03 19:31:44 -0800251 void addPreferredActivity(in IntentFilter filter, int match,
Amith Yamasania3f133a2012-08-09 17:11:28 -0700252 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100253
254 void replacePreferredActivity(in IntentFilter filter, int match,
Amith Yamasani41c1ded2014-08-05 11:15:05 -0700255 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100256
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 void clearPackagePreferredActivities(String packageName);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100258
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800259 int getPreferredActivities(out List<IntentFilter> outFilters,
260 out List<ComponentName> outActivities, String packageName);
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700261
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000262 void addPersistentPreferredActivity(in IntentFilter filter, in ComponentName activity, int userId);
263
264 void clearPackagePersistentPreferredActivities(String packageName, int userId);
265
Nicolas Prevot3f7777f2014-07-24 15:58:39 +0100266 void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000267 int sourceUserId, int targetUserId, int flags);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000268
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000269 void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000270
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800271 /**
Christopher Tatee012a232015-04-01 17:18:50 -0700272 * Backup/restore support - only the system uid may use these.
273 */
274 byte[] getPreferredActivityBackup(int userId);
275 void restorePreferredActivities(in byte[] backup, int userId);
276
277 /**
Christopher Tatea2a0850d2013-09-05 16:38:58 -0700278 * Report the set of 'Home' activity candidates, plus (if any) which of them
279 * is the current "always use this one" setting.
280 */
281 ComponentName getHomeActivities(out List<ResolveInfo> outHomeCandidates);
282
283 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800284 * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
285 */
286 void setComponentEnabledSetting(in ComponentName componentName,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700287 in int newState, in int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800288
289 /**
290 * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
291 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700292 int getComponentEnabledSetting(in ComponentName componentName, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800293
294 /**
295 * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
296 */
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -0700297 void setApplicationEnabledSetting(in String packageName, in int newState, int flags,
298 int userId, String callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800299
300 /**
301 * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
302 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700303 int getApplicationEnabledSetting(in String packageName, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800304
305 /**
Dianne Hackborne7f97212011-02-24 14:40:20 -0800306 * Set whether the given package should be considered stopped, making
307 * it not visible to implicit intents that filter out stopped packages.
308 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700309 void setPackageStoppedState(String packageName, boolean stopped, int userId);
Dianne Hackborne7f97212011-02-24 14:40:20 -0800310
311 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800312 * Free storage by deleting LRU sorted list of cache files across
313 * all applications. If the currently available free storage
314 * on the device is greater than or equal to the requested
315 * free storage, no cache files are cleared. If the currently
316 * available storage on the device is less than the requested
317 * free storage, some or all of the cache files across
318 * all applications are deleted (based on last accessed time)
319 * to increase the free storage space on the device to
320 * the requested value. There is no guarantee that clearing all
321 * the cache files from all applications will clear up
322 * enough storage to achieve the desired value.
323 * @param freeStorageSize The number of bytes of storage to be
324 * freed by the system. Say if freeStorageSize is XX,
325 * and the current free storage is YY,
326 * if XX is less than YY, just return. if not free XX-YY number
327 * of bytes if possible.
328 * @param observer call back used to notify when
329 * the operation is completed
330 */
331 void freeStorageAndNotify(in long freeStorageSize,
332 IPackageDataObserver observer);
333
334 /**
335 * Free storage by deleting LRU sorted list of cache files across
336 * all applications. If the currently available free storage
337 * on the device is greater than or equal to the requested
338 * free storage, no cache files are cleared. If the currently
339 * available storage on the device is less than the requested
340 * free storage, some or all of the cache files across
341 * all applications are deleted (based on last accessed time)
342 * to increase the free storage space on the device to
343 * the requested value. There is no guarantee that clearing all
344 * the cache files from all applications will clear up
345 * enough storage to achieve the desired value.
346 * @param freeStorageSize The number of bytes of storage to be
347 * freed by the system. Say if freeStorageSize is XX,
348 * and the current free storage is YY,
349 * if XX is less than YY, just return. if not free XX-YY number
350 * of bytes if possible.
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700351 * @param pi IntentSender call back used to
352 * notify when the operation is completed.May be null
353 * to indicate that no call back is desired.
354 */
Suchi Amalapurapubc806f62009-06-17 15:18:19 -0700355 void freeStorage(in long freeStorageSize,
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700356 in IntentSender pi);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800357
358 /**
359 * Delete all the cache files in an applications cache directory
360 * @param packageName The package name of the application whose cache
361 * files need to be deleted
362 * @param observer a callback used to notify when the deletion is finished.
363 */
364 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
365
366 /**
367 * Clear the user data directory of an application.
368 * @param packageName The package name of the application whose cache
369 * files need to be deleted
370 * @param observer a callback used to notify when the operation is completed.
371 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700372 void clearApplicationUserData(in String packageName, IPackageDataObserver observer, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373
374 /**
375 * Get package statistics including the code, data and cache size for
376 * an already installed package
377 * @param packageName The package name of the application
Dianne Hackborn0c380492012-08-20 17:23:30 -0700378 * @param userHandle Which user the size should be retrieved for
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800379 * @param observer a callback to use to notify when the asynchronous
380 * retrieval of information is complete.
381 */
Dianne Hackborn0c380492012-08-20 17:23:30 -0700382 void getPackageSizeInfo(in String packageName, int userHandle, IPackageStatsObserver observer);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800383
384 /**
385 * Get a list of shared libraries that are available on the
386 * system.
387 */
388 String[] getSystemSharedLibraryNames();
389
Dianne Hackborn49237342009-08-27 20:08:01 -0700390 /**
391 * Get a list of features that are available on the
392 * system.
393 */
394 FeatureInfo[] getSystemAvailableFeatures();
395
Dianne Hackborn039c68e2009-09-26 16:39:23 -0700396 boolean hasSystemFeature(String name);
397
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 void enterSafeMode();
399 boolean isSafeMode();
400 void systemReady();
401 boolean hasSystemUidErrors();
Dianne Hackborn661cd522011-08-22 00:26:20 -0700402
403 /**
404 * Ask the package manager to perform boot-time dex-opt of all
405 * existing packages.
406 */
407 void performBootDexOpt();
408
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700409 /**
410 * Ask the package manager to perform dex-opt (if needed) on the given
Narayan Kamath20531682014-07-14 13:18:43 +0100411 * package and for the given instruction set if it already hasn't done
412 * so.
413 *
414 * If the supplied instructionSet is null, the package manager will use
415 * the packages default instruction set.
416 *
417 * In most cases, apps are dexopted in advance and this function will
418 * be a no-op.
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700419 */
Narayan Kamath20531682014-07-14 13:18:43 +0100420 boolean performDexOptIfNeeded(String packageName, String instructionSet);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800421
Jeff Sharkey20e0c502014-07-25 14:09:37 -0700422 void forceDexOpt(String packageName);
423
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800424 /**
425 * Update status of external media on the package manager to scan and
426 * install packages installed on the external media. Like say the
427 * MountService uses this to call into the package manager to update
428 * status of sdcard.
429 */
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -0700430 void updateExternalMediaStatus(boolean mounted, boolean reportStatus);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800431
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700432 PackageCleanItem nextPackageToClean(in PackageCleanItem lastPackage);
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800433
434 void movePackage(String packageName, IPackageMoveObserver observer, int flags);
Jeff Sharkeyb2b9ab82015-04-05 21:10:42 -0700435 void movePackageAndData(String packageName, String volumeUuid, IPackageMoveObserver observer);
436
Dianne Hackbornd7c09682010-03-30 10:42:20 -0700437 boolean addPermissionAsync(in PermissionInfo info);
Suchi Amalapurapu40e47252010-04-07 16:15:50 -0700438
439 boolean setInstallLocation(int loc);
440 int getInstallLocation();
Amith Yamasani0b285492011-04-14 17:35:23 -0700441
Amith Yamasani67df64b2012-12-14 12:09:36 -0800442 int installExistingPackageAsUser(String packageName, int userId);
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700443
Kenny Root3a9b5fb2011-09-20 14:15:38 -0700444 void verifyPendingInstall(int id, int verificationCode);
rich canningsd9ef3e52012-08-22 14:28:05 -0700445 void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay);
Kenny Root0aaa0d92011-09-12 16:42:55 -0700446
Fabrice Di Megliod3d8a322015-04-01 15:58:47 -0700447 void verifyIntentFilter(int id, int verificationCode, in List<String> failedDomains);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800448 int getIntentVerificationStatus(String packageName, int userId);
449 boolean updateIntentVerificationStatus(String packageName, int status, int userId);
450 List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName);
Fabrice Di Meglio07885952015-04-06 19:41:28 -0700451 List<IntentFilter> getAllIntentFilters(String packageName);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800452
Fabrice Di Meglio62271722015-04-10 17:24:02 -0700453 boolean setDefaultBrowserPackageName(String packageName, int userId);
454 String getDefaultBrowserPackageName(int userId);
455
Kenny Root0aaa0d92011-09-12 16:42:55 -0700456 VerifierDeviceIdentity getVerifierDeviceIdentity();
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700457
458 boolean isFirstBoot();
Dianne Hackborn13579ed2012-11-28 18:05:36 -0800459 boolean isOnlyCoreApps();
Jeff Hao9f60c082014-10-28 18:51:07 -0700460 boolean isUpgrade();
Amith Yamasani742a6712011-05-04 14:49:28 -0700461
Jeff Sharkey5d32e772012-04-12 15:59:23 -0700462 void setPermissionEnforced(String permission, boolean enforced);
463 boolean isPermissionEnforced(String permission);
Jeff Sharkeyf6f7f1d2012-06-12 17:12:08 -0700464
465 /** Reflects current DeviceStorageMonitorService state */
466 boolean isStorageLow();
Amith Yamasani655d0e22013-06-12 14:19:10 -0700467
Amith Yamasanie5bcff62014-07-19 15:44:09 -0700468 boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId);
469 boolean getApplicationHiddenSettingAsUser(String packageName, int userId);
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -0700470
471 IPackageInstaller getPackageInstaller();
Kenny Guyc13053b2014-05-29 14:17:17 +0100472
473 boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId);
474 boolean getBlockUninstallForUser(String packageName, int userId);
dcashman9d2f4412014-06-09 09:27:54 -0700475
dcashmanc6f22492014-08-14 09:54:51 -0700476 KeySet getKeySetByAlias(String packageName, String alias);
477 KeySet getSigningKeySet(String packageName);
478 boolean isPackageSignedByKeySet(String packageName, in KeySet ks);
479 boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800480}