blob: 9959f27496097c684805189a3473c8d1a85f2de9 [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;
Svet Ganov2acf0632015-11-24 19:10:59 -080026import android.content.pm.EphemeralApplicationInfo;
Dianne Hackborn49237342009-08-27 20:08:01 -070027import android.content.pm.FeatureInfo;
Christopher Tatef1977b42014-03-24 16:25:51 -070028import android.content.pm.IPackageInstallObserver2;
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070029import android.content.pm.IPackageInstaller;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.IPackageDeleteObserver;
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -070031import android.content.pm.IPackageDeleteObserver2;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.pm.IPackageDataObserver;
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -080033import android.content.pm.IPackageMoveObserver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.content.pm.IPackageStatsObserver;
Svetoslavf7c06eb2015-06-10 18:43:22 -070035import android.content.pm.IOnPermissionsChangeListener;
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080036import android.content.pm.IntentFilterVerificationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.content.pm.InstrumentationInfo;
dcashmanc6f22492014-08-14 09:54:51 -070038import android.content.pm.KeySet;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.content.pm.PackageInfo;
Kenny Root5ab21572011-07-27 11:11:19 -070040import android.content.pm.ManifestDigest;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070041import android.content.pm.PackageCleanItem;
Kenny Root0e2c0f32011-04-15 17:50:10 -070042import android.content.pm.ParceledListSlice;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043import android.content.pm.ProviderInfo;
44import android.content.pm.PermissionGroupInfo;
45import android.content.pm.PermissionInfo;
46import android.content.pm.ResolveInfo;
47import android.content.pm.ServiceInfo;
Amith Yamasani0b285492011-04-14 17:35:23 -070048import android.content.pm.UserInfo;
Kenny Root0aaa0d92011-09-12 16:42:55 -070049import android.content.pm.VerifierDeviceIdentity;
Svet Ganov2acf0632015-11-24 19:10:59 -080050import android.graphics.Bitmap;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import android.net.Uri;
Svetoslavc6d1c342015-02-26 14:44:43 -080052import android.os.Bundle;
Amith Yamasanib8151ec2012-04-18 18:02:48 -070053import android.os.ParcelFileDescriptor;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070054import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055
56/**
57 * See {@link PackageManager} for documentation on most of the APIs
58 * here.
Svetoslavc6d1c342015-02-26 14:44:43 -080059 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080060 * {@hide}
61 */
62interface IPackageManager {
Jeff Sharkey8924e872015-11-30 12:52:10 -070063 void checkPackageStartable(String packageName, int userId);
Christopher Tateba629da2013-11-13 17:42:28 -080064 boolean isPackageAvailable(String packageName, int userId);
Amith Yamasani483f3b02012-03-13 16:08:00 -070065 PackageInfo getPackageInfo(String packageName, int flags, int userId);
Jeff Sharkeycd654482016-01-08 17:42:11 -070066 int getPackageUid(String packageName, int flags, int userId);
67 int[] getPackageGids(String packageName, int flags, int userId);
Svetoslavc6d1c342015-02-26 14:44:43 -080068
Dianne Hackborn47096932010-02-11 15:57:09 -080069 String[] currentToCanonicalPackageNames(in String[] names);
70 String[] canonicalToCurrentPackageNames(in String[] names);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080071
72 PermissionInfo getPermissionInfo(String name, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080073
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074 List<PermissionInfo> queryPermissionsByGroup(String group, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080075
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080076 PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080077
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 List<PermissionGroupInfo> getAllPermissionGroups(int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080079
Amith Yamasani483f3b02012-03-13 16:08:00 -070080 ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080081
Amith Yamasani483f3b02012-03-13 16:08:00 -070082 ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083
Dianne Hackborn91097de2014-04-04 18:02:06 -070084 boolean activitySupportsIntent(in ComponentName className, in Intent intent,
85 String resolvedType);
86
Amith Yamasani483f3b02012-03-13 16:08:00 -070087 ActivityInfo getReceiverInfo(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 ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090
Amith Yamasani483f3b02012-03-13 16:08:00 -070091 ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId);
Dianne Hackborn361199b2010-08-30 17:42:07 -070092
Svetoslavc6d1c342015-02-26 14:44:43 -080093 int checkPermission(String permName, String pkgName, int userId);
94
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 int checkUidPermission(String permName, int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -080096
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080097 boolean addPermission(in PermissionInfo info);
Svetoslavc6d1c342015-02-26 14:44:43 -080098
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 void removePermission(String name);
Dianne Hackborne639da72012-02-21 15:11:13 -0800100
Svet Ganov8c7f7002015-05-07 10:48:44 -0700101 void grantRuntimePermission(String packageName, String permissionName, int userId);
Dianne Hackborne639da72012-02-21 15:11:13 -0800102
Svet Ganov8c7f7002015-05-07 10:48:44 -0700103 void revokeRuntimePermission(String packageName, String permissionName, int userId);
104
Dianne Hackbornca8e6da2015-06-24 15:19:17 -0700105 void resetRuntimePermissions();
106
Svet Ganov8c7f7002015-05-07 10:48:44 -0700107 int getPermissionFlags(String permissionName, String packageName, int userId);
108
109 void updatePermissionFlags(String permissionName, String packageName, int flagMask,
110 int flagValues, int userId);
Dianne Hackborne639da72012-02-21 15:11:13 -0800111
Amith Yamasani0bf8f7c2015-06-22 13:00:32 -0700112 void updatePermissionFlagsForAllApps(int flagMask, int flagValues, int userId);
113
Svetoslav20770dd2015-05-29 15:43:04 -0700114 boolean shouldShowRequestPermissionRationale(String permissionName,
115 String packageName, int userId);
116
Dianne Hackborn854060af2009-07-09 18:14:31 -0700117 boolean isProtectedBroadcast(String actionName);
Svetoslavc6d1c342015-02-26 14:44:43 -0800118
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800119 int checkSignatures(String pkg1, String pkg2);
Svetoslavc6d1c342015-02-26 14:44:43 -0800120
Dianne Hackborn766cbfe2009-08-12 18:33:39 -0700121 int checkUidSignatures(int uid1, int uid2);
Svetoslavc6d1c342015-02-26 14:44:43 -0800122
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800123 String[] getPackagesForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800124
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 String getNameForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800126
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127 int getUidForSharedUser(String sharedUserName);
Ben Gruverdd72c9e2013-08-06 12:34:17 -0700128
129 int getFlagsForUid(int uid);
130
Alex Klyubinb9f8a522015-02-03 11:12:59 -0800131 int getPrivateFlagsForUid(int uid);
132
Dianne Hackborn2d7576b2014-10-03 16:26:04 -0700133 boolean isUidPrivileged(int uid);
134
Dianne Hackborn33f5ddd2014-07-21 15:35:45 -0700135 String[] getAppOpPermissionPackages(String permissionName);
136
Amith Yamasani483f3b02012-03-13 16:08:00 -0700137 ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800138
Nicolas Prevot81948992014-05-16 18:25:26 +0100139 boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000140
Svetoslavc6d1c342015-02-26 14:44:43 -0800141 List<ResolveInfo> queryIntentActivities(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
144 List<ResolveInfo> queryIntentActivityOptions(
145 in ComponentName caller, in Intent[] specifics,
146 in String[] specificTypes, in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700147 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800148
149 List<ResolveInfo> queryIntentReceivers(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700150 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800151
152 ResolveInfo resolveService(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700153 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800154
155 List<ResolveInfo> queryIntentServices(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700156 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800157
Jeff Sharkey85f5f812013-10-07 10:16:12 -0700158 List<ResolveInfo> queryIntentContentProviders(in Intent intent,
159 String resolvedType, int flags, int userId);
160
Kenny Root0e2c0f32011-04-15 17:50:10 -0700161 /**
162 * This implements getInstalledPackages via a "last returned row"
163 * mechanism that is not exposed in the API. This is to get around the IPC
164 * limit that kicks in when flags are included that bloat up the data
165 * returned.
166 */
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800167 ParceledListSlice getInstalledPackages(int flags, in int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800168
Kenny Root0e2c0f32011-04-15 17:50:10 -0700169 /**
Dianne Hackborne7991752013-01-16 17:56:46 -0800170 * This implements getPackagesHoldingPermissions via a "last returned row"
171 * mechanism that is not exposed in the API. This is to get around the IPC
172 * limit that kicks in when flags are included that bloat up the data
173 * returned.
174 */
175 ParceledListSlice getPackagesHoldingPermissions(in String[] permissions,
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800176 int flags, int userId);
Dianne Hackborne7991752013-01-16 17:56:46 -0800177
178 /**
Kenny Root0e2c0f32011-04-15 17:50:10 -0700179 * This implements getInstalledApplications via a "last returned row"
180 * mechanism that is not exposed in the API. This is to get around the IPC
181 * limit that kicks in when flags are included that bloat up the data
182 * returned.
183 */
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800184 ParceledListSlice getInstalledApplications(int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800185
186 /**
187 * Retrieve all applications that are marked as persistent.
Svetoslavc6d1c342015-02-26 14:44:43 -0800188 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800189 * @return A List&lt;applicationInfo> containing one entry for each persistent
190 * application.
191 */
192 List<ApplicationInfo> getPersistentApplications(int flags);
193
Amith Yamasani483f3b02012-03-13 16:08:00 -0700194 ProviderInfo resolveContentProvider(String name, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195
196 /**
197 * Retrieve sync information for all content providers.
Svetoslavc6d1c342015-02-26 14:44:43 -0800198 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800199 * @param outNames Filled in with a list of the root names of the content
200 * providers that can sync.
201 * @param outInfo Filled in with a list of the ProviderInfo for each
202 * name in 'outNames'.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800203 */
204 void querySyncProviders(inout List<String> outNames,
205 inout List<ProviderInfo> outInfo);
206
Dianne Hackborn28ec27c2015-08-03 15:28:28 -0700207 ParceledListSlice queryContentProviders(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800208 String processName, int uid, int flags);
209
210 InstrumentationInfo getInstrumentationInfo(
211 in ComponentName className, int flags);
212
213 List<InstrumentationInfo> queryInstrumentation(
214 String targetPackage, int flags);
215
Todd Kennedya6793232016-02-24 22:46:00 +0000216 /** @deprecated Use PackageInstaller instead */
Amith Yamasanidda003f2014-08-28 18:06:51 -0700217 void installPackageAsUser(in String originPath,
218 in IPackageInstallObserver2 observer,
219 int flags,
220 in String installerPackageName,
Amith Yamasanidda003f2014-08-28 18:06:51 -0700221 int userId);
222
Christopher Tate1bb69062010-02-19 17:02:12 -0800223 void finishPackageInstall(int token);
224
Dianne Hackborn880119b2010-11-18 22:26:40 -0800225 void setInstallerPackageName(in String targetPackage, in String installerPackageName);
226
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700227 /** @deprecated rawr, don't call AIDL methods directly! */
228 void deletePackageAsUser(in String packageName, IPackageDeleteObserver observer,
229 int userId, int flags);
230
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800231 /**
Amith Yamasani67df64b2012-12-14 12:09:36 -0800232 * Delete a package for a specific user.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800233 *
234 * @param packageName The fully qualified name of the package to delete.
235 * @param observer a callback to use to notify when the package deletion in finished.
Amith Yamasani67df64b2012-12-14 12:09:36 -0800236 * @param userId the id of the user for whom to delete the package
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237 * @param flags - possible values: {@link #DONT_DELETE_DATA}
238 */
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700239 void deletePackage(in String packageName, IPackageDeleteObserver2 observer, int userId, int flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800240
Jacek Surazski65e13172009-04-28 15:26:38 +0200241 String getInstallerPackageName(in String packageName);
242
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800243 void addPackageToPreferred(String packageName);
Amith Yamasani67df64b2012-12-14 12:09:36 -0800244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 void removePackageFromPreferred(String packageName);
Amith Yamasani67df64b2012-12-14 12:09:36 -0800246
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800247 List<PackageInfo> getPreferredPackages(int flags);
248
Svet Ganov9c8b8ab2015-07-23 09:32:26 -0700249 void resetApplicationPreferences(int userId);
Dianne Hackborn8a2ed1d2013-01-29 15:18:29 -0800250
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700251 ResolveInfo getLastChosenActivity(in Intent intent,
252 String resolvedType, int flags);
253
254 void setLastChosenActivity(in Intent intent, String resolvedType, int flags,
255 in IntentFilter filter, int match, in ComponentName activity);
256
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 void addPreferredActivity(in IntentFilter filter, int match,
Amith Yamasania3f133a2012-08-09 17:11:28 -0700258 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100259
260 void replacePreferredActivity(in IntentFilter filter, int match,
Amith Yamasani41c1ded2014-08-05 11:15:05 -0700261 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100262
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800263 void clearPackagePreferredActivities(String packageName);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 int getPreferredActivities(out List<IntentFilter> outFilters,
266 out List<ComponentName> outActivities, String packageName);
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700267
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000268 void addPersistentPreferredActivity(in IntentFilter filter, in ComponentName activity, int userId);
269
270 void clearPackagePersistentPreferredActivities(String packageName, int userId);
271
Nicolas Prevot3f7777f2014-07-24 15:58:39 +0100272 void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000273 int sourceUserId, int targetUserId, int flags);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000274
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000275 void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000276
Andrei Stingaceanueb84b182016-01-26 18:39:55 +0000277 String[] setPackagesSuspendedAsUser(in String[] packageNames, boolean suspended, int userId);
Andrei Stingaceanu355b2322016-02-12 16:43:51 +0000278 boolean isPackageSuspendedForUser(String packageName, int userId);
Andrei Stingaceanu1e283912015-11-26 15:26:28 +0000279
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800280 /**
Christopher Tatee012a232015-04-01 17:18:50 -0700281 * Backup/restore support - only the system uid may use these.
282 */
283 byte[] getPreferredActivityBackup(int userId);
284 void restorePreferredActivities(in byte[] backup, int userId);
Christopher Tate6038d152015-06-17 13:07:46 -0700285 byte[] getDefaultAppsBackup(int userId);
286 void restoreDefaultApps(in byte[] backup, int userId);
287 byte[] getIntentFilterVerificationBackup(int userId);
288 void restoreIntentFilterVerification(in byte[] backup, int userId);
Christopher Tatee9fd1fa2015-09-15 16:43:07 -0700289 byte[] getPermissionGrantBackup(int userId);
290 void restorePermissionGrants(in byte[] backup, int userId);
Christopher Tatee012a232015-04-01 17:18:50 -0700291
292 /**
Christopher Tatea2a0850d2013-09-05 16:38:58 -0700293 * Report the set of 'Home' activity candidates, plus (if any) which of them
294 * is the current "always use this one" setting.
295 */
296 ComponentName getHomeActivities(out List<ResolveInfo> outHomeCandidates);
297
298 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800299 * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
300 */
301 void setComponentEnabledSetting(in ComponentName componentName,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700302 in int newState, in int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800303
304 /**
305 * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
306 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700307 int getComponentEnabledSetting(in ComponentName componentName, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700308
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800309 /**
310 * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
311 */
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -0700312 void setApplicationEnabledSetting(in String packageName, in int newState, int flags,
313 int userId, String callingPackage);
Jeff Davidson2a880312015-06-22 16:54:34 -0700314
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800315 /**
316 * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
317 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700318 int getApplicationEnabledSetting(in String packageName, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700319
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800320 /**
Dianne Hackborne7f97212011-02-24 14:40:20 -0800321 * Set whether the given package should be considered stopped, making
322 * it not visible to implicit intents that filter out stopped packages.
323 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700324 void setPackageStoppedState(String packageName, boolean stopped, int userId);
Dianne Hackborne7f97212011-02-24 14:40:20 -0800325
326 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800327 * Free storage by deleting LRU sorted list of cache files across
328 * all applications. If the currently available free storage
329 * on the device is greater than or equal to the requested
330 * free storage, no cache files are cleared. If the currently
331 * available storage on the device is less than the requested
332 * free storage, some or all of the cache files across
333 * all applications are deleted (based on last accessed time)
334 * to increase the free storage space on the device to
335 * the requested value. There is no guarantee that clearing all
336 * the cache files from all applications will clear up
337 * enough storage to achieve the desired value.
338 * @param freeStorageSize The number of bytes of storage to be
339 * freed by the system. Say if freeStorageSize is XX,
340 * and the current free storage is YY,
341 * if XX is less than YY, just return. if not free XX-YY number
342 * of bytes if possible.
343 * @param observer call back used to notify when
344 * the operation is completed
345 */
Jeff Sharkey529f91f2015-04-18 20:23:13 -0700346 void freeStorageAndNotify(in String volumeUuid, in long freeStorageSize,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800347 IPackageDataObserver observer);
348
349 /**
350 * Free storage by deleting LRU sorted list of cache files across
351 * all applications. If the currently available free storage
352 * on the device is greater than or equal to the requested
353 * free storage, no cache files are cleared. If the currently
354 * available storage on the device is less than the requested
355 * free storage, some or all of the cache files across
356 * all applications are deleted (based on last accessed time)
357 * to increase the free storage space on the device to
358 * the requested value. There is no guarantee that clearing all
359 * the cache files from all applications will clear up
360 * enough storage to achieve the desired value.
361 * @param freeStorageSize The number of bytes of storage to be
362 * freed by the system. Say if freeStorageSize is XX,
363 * and the current free storage is YY,
364 * if XX is less than YY, just return. if not free XX-YY number
365 * of bytes if possible.
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700366 * @param pi IntentSender call back used to
367 * notify when the operation is completed.May be null
368 * to indicate that no call back is desired.
369 */
Jeff Sharkey529f91f2015-04-18 20:23:13 -0700370 void freeStorage(in String volumeUuid, in long freeStorageSize,
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700371 in IntentSender pi);
Jeff Davidson2a880312015-06-22 16:54:34 -0700372
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373 /**
374 * Delete all the cache files in an applications cache directory
375 * @param packageName The package name of the application whose cache
376 * files need to be deleted
377 * @param observer a callback used to notify when the deletion is finished.
378 */
379 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
Jeff Davidson2a880312015-06-22 16:54:34 -0700380
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 /**
382 * Clear the user data directory of an application.
383 * @param packageName The package name of the application whose cache
384 * files need to be deleted
385 * @param observer a callback used to notify when the operation is completed.
386 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700387 void clearApplicationUserData(in String packageName, IPackageDataObserver observer, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700388
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800389 /**
390 * Get package statistics including the code, data and cache size for
391 * an already installed package
392 * @param packageName The package name of the application
Dianne Hackborn0c380492012-08-20 17:23:30 -0700393 * @param userHandle Which user the size should be retrieved for
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800394 * @param observer a callback to use to notify when the asynchronous
395 * retrieval of information is complete.
396 */
Dianne Hackborn0c380492012-08-20 17:23:30 -0700397 void getPackageSizeInfo(in String packageName, int userHandle, IPackageStatsObserver observer);
Jeff Davidson2a880312015-06-22 16:54:34 -0700398
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800399 /**
400 * Get a list of shared libraries that are available on the
401 * system.
402 */
403 String[] getSystemSharedLibraryNames();
404
Dianne Hackborn49237342009-08-27 20:08:01 -0700405 /**
406 * Get a list of features that are available on the
407 * system.
408 */
409 FeatureInfo[] getSystemAvailableFeatures();
410
Jeff Sharkey115d2c12016-02-15 17:25:57 -0700411 boolean hasSystemFeature(String name, int version);
Jeff Davidson2a880312015-06-22 16:54:34 -0700412
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800413 void enterSafeMode();
414 boolean isSafeMode();
415 void systemReady();
416 boolean hasSystemUidErrors();
Dianne Hackborn661cd522011-08-22 00:26:20 -0700417
418 /**
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000419 * Ask the package manager to fstrim the disk if needed.
Dianne Hackborn661cd522011-08-22 00:26:20 -0700420 */
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000421 void performFstrimIfNeeded();
422
423 /**
David Brazdila0e10432016-01-20 14:04:40 +0000424 * Ask the package manager to extract packages if needed, to save
425 * the VM unzipping the APK in memory during launch.
426 */
427 void extractPackagesIfNeeded();
428
429 /**
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000430 * Notify the package manager that a package is going to be used.
431 */
432 void notifyPackageUse(String packageName);
Dianne Hackborn661cd522011-08-22 00:26:20 -0700433
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700434 /**
435 * Ask the package manager to perform dex-opt (if needed) on the given
Narayan Kamath20531682014-07-14 13:18:43 +0100436 * package and for the given instruction set if it already hasn't done
437 * so.
438 *
439 * If the supplied instructionSet is null, the package manager will use
440 * the packages default instruction set.
441 *
442 * In most cases, apps are dexopted in advance and this function will
443 * be a no-op.
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700444 */
Narayan Kamath20531682014-07-14 13:18:43 +0100445 boolean performDexOptIfNeeded(String packageName, String instructionSet);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800446
David Brazdil493411a2016-02-01 13:48:46 +0000447 boolean performDexOpt(String packageName, String instructionSet, boolean useProfiles,
448 boolean extractOnly, boolean force);
449
Jeff Sharkey20e0c502014-07-25 14:09:37 -0700450 void forceDexOpt(String packageName);
451
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800452 /**
453 * Update status of external media on the package manager to scan and
454 * install packages installed on the external media. Like say the
455 * MountService uses this to call into the package manager to update
456 * status of sdcard.
457 */
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -0700458 void updateExternalMediaStatus(boolean mounted, boolean reportStatus);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800459
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700460 PackageCleanItem nextPackageToClean(in PackageCleanItem lastPackage);
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800461
Jeff Sharkey620b32b2015-04-23 19:36:02 -0700462 int getMoveStatus(int moveId);
463
464 void registerMoveCallback(in IPackageMoveObserver callback);
465 void unregisterMoveCallback(in IPackageMoveObserver callback);
466
467 int movePackage(in String packageName, in String volumeUuid);
468 int movePrimaryStorage(in String volumeUuid);
Jeff Sharkeyb2b9ab82015-04-05 21:10:42 -0700469
Dianne Hackbornd7c09682010-03-30 10:42:20 -0700470 boolean addPermissionAsync(in PermissionInfo info);
Suchi Amalapurapu40e47252010-04-07 16:15:50 -0700471
472 boolean setInstallLocation(int loc);
473 int getInstallLocation();
Amith Yamasani0b285492011-04-14 17:35:23 -0700474
Amith Yamasani67df64b2012-12-14 12:09:36 -0800475 int installExistingPackageAsUser(String packageName, int userId);
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700476
Kenny Root3a9b5fb2011-09-20 14:15:38 -0700477 void verifyPendingInstall(int id, int verificationCode);
rich canningsd9ef3e52012-08-22 14:28:05 -0700478 void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay);
Kenny Root0aaa0d92011-09-12 16:42:55 -0700479
Fabrice Di Megliod3d8a322015-04-01 15:58:47 -0700480 void verifyIntentFilter(int id, int verificationCode, in List<String> failedDomains);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800481 int getIntentVerificationStatus(String packageName, int userId);
482 boolean updateIntentVerificationStatus(String packageName, int status, int userId);
483 List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName);
Fabrice Di Meglio07885952015-04-06 19:41:28 -0700484 List<IntentFilter> getAllIntentFilters(String packageName);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800485
Fabrice Di Meglio62271722015-04-10 17:24:02 -0700486 boolean setDefaultBrowserPackageName(String packageName, int userId);
487 String getDefaultBrowserPackageName(int userId);
488
Kenny Root0aaa0d92011-09-12 16:42:55 -0700489 VerifierDeviceIdentity getVerifierDeviceIdentity();
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700490
491 boolean isFirstBoot();
Dianne Hackborn13579ed2012-11-28 18:05:36 -0800492 boolean isOnlyCoreApps();
Jeff Hao9f60c082014-10-28 18:51:07 -0700493 boolean isUpgrade();
Amith Yamasani742a6712011-05-04 14:49:28 -0700494
Jeff Sharkey5d32e772012-04-12 15:59:23 -0700495 void setPermissionEnforced(String permission, boolean enforced);
496 boolean isPermissionEnforced(String permission);
Jeff Sharkeyf6f7f1d2012-06-12 17:12:08 -0700497
498 /** Reflects current DeviceStorageMonitorService state */
499 boolean isStorageLow();
Amith Yamasani655d0e22013-06-12 14:19:10 -0700500
Amith Yamasanie5bcff62014-07-19 15:44:09 -0700501 boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId);
502 boolean getApplicationHiddenSettingAsUser(String packageName, int userId);
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -0700503
504 IPackageInstaller getPackageInstaller();
Kenny Guyc13053b2014-05-29 14:17:17 +0100505
506 boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId);
507 boolean getBlockUninstallForUser(String packageName, int userId);
dcashman9d2f4412014-06-09 09:27:54 -0700508
dcashmanc6f22492014-08-14 09:54:51 -0700509 KeySet getKeySetByAlias(String packageName, String alias);
510 KeySet getSigningKeySet(String packageName);
511 boolean isPackageSignedByKeySet(String packageName, in KeySet ks);
512 boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks);
Svetoslavf7c06eb2015-06-10 18:43:22 -0700513
514 void addOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
515 void removeOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
Svetoslavcdfd2302015-06-25 19:07:31 -0700516 void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
Svet Ganovad3b2972015-07-07 22:49:17 -0700517
518 boolean isPermissionRevokedByPolicy(String permission, String packageName, int userId);
Svet Ganovf1b7f202015-07-29 08:33:42 -0700519
520 String getPermissionControllerPackageName();
Svet Ganov2acf0632015-11-24 19:10:59 -0800521
522 ParceledListSlice getEphemeralApplications(int userId);
523 byte[] getEphemeralApplicationCookie(String packageName, int userId);
524 boolean setEphemeralApplicationCookie(String packageName, in byte[] cookie, int userId);
525 Bitmap getEphemeralApplicationIcon(String packageName, int userId);
526 boolean isEphemeralApplication(String packageName, int userId);
Fyodor Kupolovbdbc9692015-12-14 13:11:13 -0800527
528 boolean setRequiredForSystemUser(String packageName, boolean systemUserApp);
Svet Ganovd7b1f4112016-02-09 18:49:23 -0800529
530 String getServicesSystemSharedLibraryPackageName();
Makoto Onukif34db0a2016-02-17 11:17:15 -0800531
532 boolean isPackageDeviceAdminOnAnyUser(String packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800533}