blob: eb0ca2ed10bef29d113b70f8c485c2fbc19b72dd [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
Jeff Sharkeyd5896632016-03-04 16:16:00 -070074 ParceledListSlice 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
Jeff Sharkeyd5896632016-03-04 16:16:00 -070078 ParceledListSlice 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
David Brazdil990fb6b2016-03-01 10:02:27 +0000123 List<String> getAllPackages();
124
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 String[] getPackagesForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800126
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127 String getNameForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800128
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 int getUidForSharedUser(String sharedUserName);
Ben Gruverdd72c9e2013-08-06 12:34:17 -0700130
131 int getFlagsForUid(int uid);
132
Alex Klyubinb9f8a522015-02-03 11:12:59 -0800133 int getPrivateFlagsForUid(int uid);
134
Dianne Hackborn2d7576b2014-10-03 16:26:04 -0700135 boolean isUidPrivileged(int uid);
136
Dianne Hackborn33f5ddd2014-07-21 15:35:45 -0700137 String[] getAppOpPermissionPackages(String permissionName);
138
Amith Yamasani483f3b02012-03-13 16:08:00 -0700139 ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800140
Nicolas Prevot81948992014-05-16 18:25:26 +0100141 boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000142
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700143 ParceledListSlice queryIntentActivities(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700144 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700146 ParceledListSlice queryIntentActivityOptions(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800147 in ComponentName caller, in Intent[] specifics,
148 in String[] specificTypes, in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700149 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800150
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700151 ParceledListSlice queryIntentReceivers(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700152 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800153
154 ResolveInfo resolveService(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700155 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800156
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700157 ParceledListSlice queryIntentServices(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700158 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800159
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700160 ParceledListSlice queryIntentContentProviders(in Intent intent,
Jeff Sharkey85f5f812013-10-07 10:16:12 -0700161 String resolvedType, int flags, int userId);
162
Kenny Root0e2c0f32011-04-15 17:50:10 -0700163 /**
164 * This implements getInstalledPackages via a "last returned row"
165 * mechanism that is not exposed in the API. This is to get around the IPC
166 * limit that kicks in when flags are included that bloat up the data
167 * returned.
168 */
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800169 ParceledListSlice getInstalledPackages(int flags, in int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800170
Kenny Root0e2c0f32011-04-15 17:50:10 -0700171 /**
Dianne Hackborne7991752013-01-16 17:56:46 -0800172 * This implements getPackagesHoldingPermissions via a "last returned row"
173 * mechanism that is not exposed in the API. This is to get around the IPC
174 * limit that kicks in when flags are included that bloat up the data
175 * returned.
176 */
177 ParceledListSlice getPackagesHoldingPermissions(in String[] permissions,
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800178 int flags, int userId);
Dianne Hackborne7991752013-01-16 17:56:46 -0800179
180 /**
Kenny Root0e2c0f32011-04-15 17:50:10 -0700181 * This implements getInstalledApplications via a "last returned row"
182 * mechanism that is not exposed in the API. This is to get around the IPC
183 * limit that kicks in when flags are included that bloat up the data
184 * returned.
185 */
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800186 ParceledListSlice getInstalledApplications(int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800187
188 /**
189 * Retrieve all applications that are marked as persistent.
Svetoslavc6d1c342015-02-26 14:44:43 -0800190 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800191 * @return A List&lt;applicationInfo> containing one entry for each persistent
192 * application.
193 */
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700194 ParceledListSlice getPersistentApplications(int flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195
Amith Yamasani483f3b02012-03-13 16:08:00 -0700196 ProviderInfo resolveContentProvider(String name, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800197
198 /**
199 * Retrieve sync information for all content providers.
Svetoslavc6d1c342015-02-26 14:44:43 -0800200 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800201 * @param outNames Filled in with a list of the root names of the content
202 * providers that can sync.
203 * @param outInfo Filled in with a list of the ProviderInfo for each
204 * name in 'outNames'.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800205 */
206 void querySyncProviders(inout List<String> outNames,
207 inout List<ProviderInfo> outInfo);
208
Dianne Hackborn28ec27c2015-08-03 15:28:28 -0700209 ParceledListSlice queryContentProviders(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800210 String processName, int uid, int flags);
211
212 InstrumentationInfo getInstrumentationInfo(
213 in ComponentName className, int flags);
214
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700215 ParceledListSlice queryInstrumentation(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800216 String targetPackage, int flags);
217
Todd Kennedya6793232016-02-24 22:46:00 +0000218 /** @deprecated Use PackageInstaller instead */
Amith Yamasanidda003f2014-08-28 18:06:51 -0700219 void installPackageAsUser(in String originPath,
220 in IPackageInstallObserver2 observer,
221 int flags,
222 in String installerPackageName,
Amith Yamasanidda003f2014-08-28 18:06:51 -0700223 int userId);
224
Christopher Tate5cf55782016-04-25 17:08:56 -0700225 void finishPackageInstall(int token, boolean didLaunch);
Christopher Tate1bb69062010-02-19 17:02:12 -0800226
Dianne Hackborn880119b2010-11-18 22:26:40 -0800227 void setInstallerPackageName(in String targetPackage, in String installerPackageName);
228
Jeff Sharkey9bc89af2017-01-11 11:25:50 -0700229 void setApplicationCategoryHint(String packageName, int categoryHint, String callerPackageName);
230
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700231 /** @deprecated rawr, don't call AIDL methods directly! */
232 void deletePackageAsUser(in String packageName, IPackageDeleteObserver observer,
233 int userId, int flags);
234
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800235 /**
Amith Yamasani67df64b2012-12-14 12:09:36 -0800236 * Delete a package for a specific user.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237 *
238 * @param packageName The fully qualified name of the package to delete.
239 * @param observer a callback to use to notify when the package deletion in finished.
Amith Yamasani67df64b2012-12-14 12:09:36 -0800240 * @param userId the id of the user for whom to delete the package
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800241 * @param flags - possible values: {@link #DONT_DELETE_DATA}
242 */
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700243 void deletePackage(in String packageName, IPackageDeleteObserver2 observer, int userId, int flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800244
Jacek Surazski65e13172009-04-28 15:26:38 +0200245 String getInstallerPackageName(in String packageName);
246
Svet Ganov9c8b8ab2015-07-23 09:32:26 -0700247 void resetApplicationPreferences(int userId);
Dianne Hackborn8a2ed1d2013-01-29 15:18:29 -0800248
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700249 ResolveInfo getLastChosenActivity(in Intent intent,
250 String resolvedType, int flags);
251
252 void setLastChosenActivity(in Intent intent, String resolvedType, int flags,
253 in IntentFilter filter, int match, in ComponentName activity);
254
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800255 void addPreferredActivity(in IntentFilter filter, int match,
Amith Yamasania3f133a2012-08-09 17:11:28 -0700256 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100257
258 void replacePreferredActivity(in IntentFilter filter, int match,
Amith Yamasani41c1ded2014-08-05 11:15:05 -0700259 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100260
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800261 void clearPackagePreferredActivities(String packageName);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100262
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800263 int getPreferredActivities(out List<IntentFilter> outFilters,
264 out List<ComponentName> outActivities, String packageName);
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700265
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000266 void addPersistentPreferredActivity(in IntentFilter filter, in ComponentName activity, int userId);
267
268 void clearPackagePersistentPreferredActivities(String packageName, int userId);
269
Nicolas Prevot3f7777f2014-07-24 15:58:39 +0100270 void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000271 int sourceUserId, int targetUserId, int flags);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000272
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000273 void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000274
Andrei Stingaceanueb84b182016-01-26 18:39:55 +0000275 String[] setPackagesSuspendedAsUser(in String[] packageNames, boolean suspended, int userId);
Andrei Stingaceanu355b2322016-02-12 16:43:51 +0000276 boolean isPackageSuspendedForUser(String packageName, int userId);
Andrei Stingaceanu1e283912015-11-26 15:26:28 +0000277
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800278 /**
Christopher Tatee012a232015-04-01 17:18:50 -0700279 * Backup/restore support - only the system uid may use these.
280 */
281 byte[] getPreferredActivityBackup(int userId);
282 void restorePreferredActivities(in byte[] backup, int userId);
Christopher Tate6038d152015-06-17 13:07:46 -0700283 byte[] getDefaultAppsBackup(int userId);
284 void restoreDefaultApps(in byte[] backup, int userId);
285 byte[] getIntentFilterVerificationBackup(int userId);
286 void restoreIntentFilterVerification(in byte[] backup, int userId);
Christopher Tatee9fd1fa2015-09-15 16:43:07 -0700287 byte[] getPermissionGrantBackup(int userId);
288 void restorePermissionGrants(in byte[] backup, int userId);
Christopher Tatee012a232015-04-01 17:18:50 -0700289
290 /**
Christopher Tatea2a0850d2013-09-05 16:38:58 -0700291 * Report the set of 'Home' activity candidates, plus (if any) which of them
292 * is the current "always use this one" setting.
293 */
294 ComponentName getHomeActivities(out List<ResolveInfo> outHomeCandidates);
295
Makoto Onuki4828a592016-03-15 18:06:57 -0700296 void setHomeActivity(in ComponentName className, int userId);
297
Christopher Tatea2a0850d2013-09-05 16:38:58 -0700298 /**
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 /**
Michal Karpinskib52a4612016-03-21 13:39:42 +0000321 * Logs process start information (including APK hash) to the security log.
322 */
323 void logAppProcessStartIfNeeded(String processName, int uid, String seinfo, String apkFile,
324 int pid);
325
326 /**
Sudheer Shankabbb3ff22015-07-09 15:39:23 +0100327 * As per {@link android.content.pm.PackageManager#flushPackageRestrictionsAsUser}.
328 */
329 void flushPackageRestrictionsAsUser(in int userId);
330
331 /**
Dianne Hackborne7f97212011-02-24 14:40:20 -0800332 * Set whether the given package should be considered stopped, making
333 * it not visible to implicit intents that filter out stopped packages.
334 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700335 void setPackageStoppedState(String packageName, boolean stopped, int userId);
Dianne Hackborne7f97212011-02-24 14:40:20 -0800336
337 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800338 * Free storage by deleting LRU sorted list of cache files across
339 * all applications. If the currently available free storage
340 * on the device is greater than or equal to the requested
341 * free storage, no cache files are cleared. If the currently
342 * available storage on the device is less than the requested
343 * free storage, some or all of the cache files across
344 * all applications are deleted (based on last accessed time)
345 * to increase the free storage space on the device to
346 * the requested value. There is no guarantee that clearing all
347 * the cache files from all applications will clear up
348 * enough storage to achieve the desired value.
349 * @param freeStorageSize The number of bytes of storage to be
350 * freed by the system. Say if freeStorageSize is XX,
351 * and the current free storage is YY,
352 * if XX is less than YY, just return. if not free XX-YY number
353 * of bytes if possible.
354 * @param observer call back used to notify when
355 * the operation is completed
356 */
Jeff Sharkey529f91f2015-04-18 20:23:13 -0700357 void freeStorageAndNotify(in String volumeUuid, in long freeStorageSize,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800358 IPackageDataObserver observer);
359
360 /**
361 * Free storage by deleting LRU sorted list of cache files across
362 * all applications. If the currently available free storage
363 * on the device is greater than or equal to the requested
364 * free storage, no cache files are cleared. If the currently
365 * available storage on the device is less than the requested
366 * free storage, some or all of the cache files across
367 * all applications are deleted (based on last accessed time)
368 * to increase the free storage space on the device to
369 * the requested value. There is no guarantee that clearing all
370 * the cache files from all applications will clear up
371 * enough storage to achieve the desired value.
372 * @param freeStorageSize The number of bytes of storage to be
373 * freed by the system. Say if freeStorageSize is XX,
374 * and the current free storage is YY,
375 * if XX is less than YY, just return. if not free XX-YY number
376 * of bytes if possible.
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700377 * @param pi IntentSender call back used to
378 * notify when the operation is completed.May be null
379 * to indicate that no call back is desired.
380 */
Jeff Sharkey529f91f2015-04-18 20:23:13 -0700381 void freeStorage(in String volumeUuid, in long freeStorageSize,
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700382 in IntentSender pi);
Jeff Davidson2a880312015-06-22 16:54:34 -0700383
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800384 /**
385 * Delete all the cache files in an applications cache directory
386 * @param packageName The package name of the application whose cache
387 * files need to be deleted
388 * @param observer a callback used to notify when the deletion is finished.
389 */
390 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
Jeff Davidson2a880312015-06-22 16:54:34 -0700391
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800392 /**
Suprabh Shukla78c9eb82016-04-12 15:51:35 -0700393 * Delete all the cache files in an applications cache directory
394 * @param packageName The package name of the application whose cache
395 * files need to be deleted
396 * @param userId the user to delete application cache for
397 * @param observer a callback used to notify when the deletion is finished.
398 */
399 void deleteApplicationCacheFilesAsUser(in String packageName, int userId, IPackageDataObserver observer);
400
401 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800402 * Clear the user data directory of an application.
403 * @param packageName The package name of the application whose cache
404 * files need to be deleted
405 * @param observer a callback used to notify when the operation is completed.
406 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700407 void clearApplicationUserData(in String packageName, IPackageDataObserver observer, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700408
David Brazdil9aa6db02016-03-08 12:57:12 +0000409 /**
410 * Clear the profile data of an application.
411 * @param packageName The package name of the application whose profile data
412 * need to be deleted
413 */
414 void clearApplicationProfileData(in String packageName);
415
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 /**
417 * Get package statistics including the code, data and cache size for
418 * an already installed package
419 * @param packageName The package name of the application
Dianne Hackborn0c380492012-08-20 17:23:30 -0700420 * @param userHandle Which user the size should be retrieved for
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800421 * @param observer a callback to use to notify when the asynchronous
422 * retrieval of information is complete.
423 */
Dianne Hackborn0c380492012-08-20 17:23:30 -0700424 void getPackageSizeInfo(in String packageName, int userHandle, IPackageStatsObserver observer);
Jeff Davidson2a880312015-06-22 16:54:34 -0700425
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 /**
427 * Get a list of shared libraries that are available on the
428 * system.
429 */
430 String[] getSystemSharedLibraryNames();
431
Dianne Hackborn49237342009-08-27 20:08:01 -0700432 /**
433 * Get a list of features that are available on the
434 * system.
435 */
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700436 ParceledListSlice getSystemAvailableFeatures();
Dianne Hackborn49237342009-08-27 20:08:01 -0700437
Jeff Sharkey115d2c12016-02-15 17:25:57 -0700438 boolean hasSystemFeature(String name, int version);
Jeff Davidson2a880312015-06-22 16:54:34 -0700439
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800440 void enterSafeMode();
441 boolean isSafeMode();
442 void systemReady();
443 boolean hasSystemUidErrors();
Dianne Hackborn661cd522011-08-22 00:26:20 -0700444
445 /**
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000446 * Ask the package manager to fstrim the disk if needed.
Dianne Hackborn661cd522011-08-22 00:26:20 -0700447 */
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000448 void performFstrimIfNeeded();
449
450 /**
David Brazdilf5c444f2016-03-30 11:45:52 +0100451 * Ask the package manager to update packages if needed.
David Brazdila0e10432016-01-20 14:04:40 +0000452 */
David Brazdilf5c444f2016-03-30 11:45:52 +0100453 void updatePackagesIfNeeded();
David Brazdila0e10432016-01-20 14:04:40 +0000454
455 /**
Brian Carlstromca82e612016-04-19 23:16:08 -0700456 * Notify the package manager that a package is going to be used and why.
457 *
458 * See PackageManager.NOTIFY_PACKAGE_USE_* for reasons.
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000459 */
Brian Carlstromca82e612016-04-19 23:16:08 -0700460 void notifyPackageUse(String packageName, int reason);
Dianne Hackborn661cd522011-08-22 00:26:20 -0700461
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700462 /**
Calin Juravle8d2a51f2016-11-23 19:50:58 +0000463 * Notify the package manager that a list of dex files have been loaded.
464 *
465 * @param loadingPackageName the name of the package who performs the load
466 * @param dexPats the list of the dex files paths that have been loaded
467 * @param loaderIsa the ISA of the loader process
468 */
469 void notifyDexLoad(String loadingPackageName, in List<String> dexPaths, String loaderIsa);
470
471 /**
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700472 * Ask the package manager to perform dex-opt (if needed) on the given
Nicolas Geoffrayfb6cf772016-05-27 13:09:19 +0100473 * package if it already hasn't done so.
Narayan Kamath20531682014-07-14 13:18:43 +0100474 *
475 * In most cases, apps are dexopted in advance and this function will
476 * be a no-op.
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700477 */
Nicolas Geoffrayfb6cf772016-05-27 13:09:19 +0100478 boolean performDexOptIfNeeded(String packageName);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800479
Andreas Gampebdd30d82016-03-20 11:32:11 -0700480 /**
481 * Ask the package manager to perform a dex-opt for the given reason. The package
482 * manager will map the reason to a compiler filter according to the current system
483 * configuration.
484 */
Nicolas Geoffrayfb6cf772016-05-27 13:09:19 +0100485 boolean performDexOpt(String packageName, boolean checkProfiles,
Andreas Gampebdd30d82016-03-20 11:32:11 -0700486 int compileReason, boolean force);
487 /**
488 * Ask the package manager to perform a dex-opt with the given compiler filter.
489 *
490 * Note: exposed only for the shell command to allow moving packages explicitly to a
491 * definite state.
492 */
Nicolas Geoffrayfb6cf772016-05-27 13:09:19 +0100493 boolean performDexOptMode(String packageName, boolean checkProfiles,
Andreas Gampebdd30d82016-03-20 11:32:11 -0700494 String targetCompilerFilter, boolean force);
David Brazdil493411a2016-02-01 13:48:46 +0000495
David Sehra8777082016-05-24 15:25:23 -0700496 /**
497 * Ask the package manager to dump profiles associated with a package.
498 */
499 void dumpProfiles(String packageName);
500
Jeff Sharkey20e0c502014-07-25 14:09:37 -0700501 void forceDexOpt(String packageName);
502
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800503 /**
504 * Update status of external media on the package manager to scan and
505 * install packages installed on the external media. Like say the
Sudheer Shanka2250d562016-11-07 15:41:02 -0800506 * StorageManagerService uses this to call into the package manager to update
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800507 * status of sdcard.
508 */
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -0700509 void updateExternalMediaStatus(boolean mounted, boolean reportStatus);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800510
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700511 PackageCleanItem nextPackageToClean(in PackageCleanItem lastPackage);
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800512
Jeff Sharkey620b32b2015-04-23 19:36:02 -0700513 int getMoveStatus(int moveId);
514
515 void registerMoveCallback(in IPackageMoveObserver callback);
516 void unregisterMoveCallback(in IPackageMoveObserver callback);
517
518 int movePackage(in String packageName, in String volumeUuid);
519 int movePrimaryStorage(in String volumeUuid);
Jeff Sharkeyb2b9ab82015-04-05 21:10:42 -0700520
Dianne Hackbornd7c09682010-03-30 10:42:20 -0700521 boolean addPermissionAsync(in PermissionInfo info);
Suchi Amalapurapu40e47252010-04-07 16:15:50 -0700522
523 boolean setInstallLocation(int loc);
524 int getInstallLocation();
Amith Yamasani0b285492011-04-14 17:35:23 -0700525
Amith Yamasani67df64b2012-12-14 12:09:36 -0800526 int installExistingPackageAsUser(String packageName, int userId);
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700527
Kenny Root3a9b5fb2011-09-20 14:15:38 -0700528 void verifyPendingInstall(int id, int verificationCode);
rich canningsd9ef3e52012-08-22 14:28:05 -0700529 void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay);
Kenny Root0aaa0d92011-09-12 16:42:55 -0700530
Fabrice Di Megliod3d8a322015-04-01 15:58:47 -0700531 void verifyIntentFilter(int id, int verificationCode, in List<String> failedDomains);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800532 int getIntentVerificationStatus(String packageName, int userId);
533 boolean updateIntentVerificationStatus(String packageName, int status, int userId);
Jeff Sharkeyd5896632016-03-04 16:16:00 -0700534 ParceledListSlice getIntentFilterVerifications(String packageName);
535 ParceledListSlice getAllIntentFilters(String packageName);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800536
Fabrice Di Meglio62271722015-04-10 17:24:02 -0700537 boolean setDefaultBrowserPackageName(String packageName, int userId);
538 String getDefaultBrowserPackageName(int userId);
539
Kenny Root0aaa0d92011-09-12 16:42:55 -0700540 VerifierDeviceIdentity getVerifierDeviceIdentity();
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700541
542 boolean isFirstBoot();
Dianne Hackborn13579ed2012-11-28 18:05:36 -0800543 boolean isOnlyCoreApps();
Jeff Hao9f60c082014-10-28 18:51:07 -0700544 boolean isUpgrade();
Amith Yamasani742a6712011-05-04 14:49:28 -0700545
Jeff Sharkey5d32e772012-04-12 15:59:23 -0700546 void setPermissionEnforced(String permission, boolean enforced);
547 boolean isPermissionEnforced(String permission);
Jeff Sharkeyf6f7f1d2012-06-12 17:12:08 -0700548
549 /** Reflects current DeviceStorageMonitorService state */
550 boolean isStorageLow();
Amith Yamasani655d0e22013-06-12 14:19:10 -0700551
Amith Yamasanie5bcff62014-07-19 15:44:09 -0700552 boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId);
553 boolean getApplicationHiddenSettingAsUser(String packageName, int userId);
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -0700554
555 IPackageInstaller getPackageInstaller();
Kenny Guyc13053b2014-05-29 14:17:17 +0100556
557 boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId);
558 boolean getBlockUninstallForUser(String packageName, int userId);
dcashman9d2f4412014-06-09 09:27:54 -0700559
dcashmanc6f22492014-08-14 09:54:51 -0700560 KeySet getKeySetByAlias(String packageName, String alias);
561 KeySet getSigningKeySet(String packageName);
562 boolean isPackageSignedByKeySet(String packageName, in KeySet ks);
563 boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks);
Svetoslavf7c06eb2015-06-10 18:43:22 -0700564
565 void addOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
566 void removeOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
Svetoslavcdfd2302015-06-25 19:07:31 -0700567 void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
Svet Ganovad3b2972015-07-07 22:49:17 -0700568
569 boolean isPermissionRevokedByPolicy(String permission, String packageName, int userId);
Svet Ganovf1b7f202015-07-29 08:33:42 -0700570
571 String getPermissionControllerPackageName();
Svet Ganov2acf0632015-11-24 19:10:59 -0800572
573 ParceledListSlice getEphemeralApplications(int userId);
574 byte[] getEphemeralApplicationCookie(String packageName, int userId);
575 boolean setEphemeralApplicationCookie(String packageName, in byte[] cookie, int userId);
576 Bitmap getEphemeralApplicationIcon(String packageName, int userId);
577 boolean isEphemeralApplication(String packageName, int userId);
Fyodor Kupolovbdbc9692015-12-14 13:11:13 -0800578
579 boolean setRequiredForSystemUser(String packageName, boolean systemUserApp);
Svet Ganovd7b1f4112016-02-09 18:49:23 -0800580
581 String getServicesSystemSharedLibraryPackageName();
Svetoslav Ganova9c25002016-04-13 19:25:56 -0700582 String getSharedSystemSharedLibraryPackageName();
Makoto Onukif34db0a2016-02-17 11:17:15 -0800583
584 boolean isPackageDeviceAdminOnAnyUser(String packageName);
Todd Kennedy39bfee52016-02-24 10:28:21 -0800585
586 List<String> getPreviousCodePaths(in String packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800587}