blob: d6b674c0edee54aa49d6a27992ef0b2e14fbc272 [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;
Todd Kennedy5cbeb592016-02-24 22:45:00 +000049import android.content.pm.VerificationParams;
Kenny Root0aaa0d92011-09-12 16:42:55 -070050import android.content.pm.VerifierDeviceIdentity;
Svet Ganov2acf0632015-11-24 19:10:59 -080051import android.graphics.Bitmap;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.net.Uri;
Svetoslavc6d1c342015-02-26 14:44:43 -080053import android.os.Bundle;
Amith Yamasanib8151ec2012-04-18 18:02:48 -070054import android.os.ParcelFileDescriptor;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070055import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
57/**
58 * See {@link PackageManager} for documentation on most of the APIs
59 * here.
Svetoslavc6d1c342015-02-26 14:44:43 -080060 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061 * {@hide}
62 */
63interface IPackageManager {
Jeff Sharkey8924e872015-11-30 12:52:10 -070064 void checkPackageStartable(String packageName, int userId);
Christopher Tateba629da2013-11-13 17:42:28 -080065 boolean isPackageAvailable(String packageName, int userId);
Amith Yamasani483f3b02012-03-13 16:08:00 -070066 PackageInfo getPackageInfo(String packageName, int flags, int userId);
Jeff Sharkeycd654482016-01-08 17:42:11 -070067 int getPackageUid(String packageName, int flags, int userId);
68 int[] getPackageGids(String packageName, int flags, int userId);
Svetoslavc6d1c342015-02-26 14:44:43 -080069
Dianne Hackborn47096932010-02-11 15:57:09 -080070 String[] currentToCanonicalPackageNames(in String[] names);
71 String[] canonicalToCurrentPackageNames(in String[] names);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080072
73 PermissionInfo getPermissionInfo(String name, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080074
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 List<PermissionInfo> queryPermissionsByGroup(String group, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077 PermissionGroupInfo getPermissionGroupInfo(String name, int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080078
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080079 List<PermissionGroupInfo> getAllPermissionGroups(int flags);
Svetoslavc6d1c342015-02-26 14:44:43 -080080
Amith Yamasani483f3b02012-03-13 16:08:00 -070081 ApplicationInfo getApplicationInfo(String packageName, int flags ,int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082
Amith Yamasani483f3b02012-03-13 16:08:00 -070083 ActivityInfo getActivityInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084
Dianne Hackborn91097de2014-04-04 18:02:06 -070085 boolean activitySupportsIntent(in ComponentName className, in Intent intent,
86 String resolvedType);
87
Amith Yamasani483f3b02012-03-13 16:08:00 -070088 ActivityInfo getReceiverInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089
Amith Yamasani483f3b02012-03-13 16:08:00 -070090 ServiceInfo getServiceInfo(in ComponentName className, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091
Amith Yamasani483f3b02012-03-13 16:08:00 -070092 ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId);
Dianne Hackborn361199b2010-08-30 17:42:07 -070093
Svetoslavc6d1c342015-02-26 14:44:43 -080094 int checkPermission(String permName, String pkgName, int userId);
95
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 int checkUidPermission(String permName, int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -080097
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080098 boolean addPermission(in PermissionInfo info);
Svetoslavc6d1c342015-02-26 14:44:43 -080099
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 void removePermission(String name);
Dianne Hackborne639da72012-02-21 15:11:13 -0800101
Svet Ganov8c7f7002015-05-07 10:48:44 -0700102 void grantRuntimePermission(String packageName, String permissionName, int userId);
Dianne Hackborne639da72012-02-21 15:11:13 -0800103
Svet Ganov8c7f7002015-05-07 10:48:44 -0700104 void revokeRuntimePermission(String packageName, String permissionName, int userId);
105
Dianne Hackbornca8e6da2015-06-24 15:19:17 -0700106 void resetRuntimePermissions();
107
Svet Ganov8c7f7002015-05-07 10:48:44 -0700108 int getPermissionFlags(String permissionName, String packageName, int userId);
109
110 void updatePermissionFlags(String permissionName, String packageName, int flagMask,
111 int flagValues, int userId);
Dianne Hackborne639da72012-02-21 15:11:13 -0800112
Amith Yamasani0bf8f7c2015-06-22 13:00:32 -0700113 void updatePermissionFlagsForAllApps(int flagMask, int flagValues, int userId);
114
Svetoslav20770dd2015-05-29 15:43:04 -0700115 boolean shouldShowRequestPermissionRationale(String permissionName,
116 String packageName, int userId);
117
Dianne Hackborn854060af2009-07-09 18:14:31 -0700118 boolean isProtectedBroadcast(String actionName);
Svetoslavc6d1c342015-02-26 14:44:43 -0800119
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800120 int checkSignatures(String pkg1, String pkg2);
Svetoslavc6d1c342015-02-26 14:44:43 -0800121
Dianne Hackborn766cbfe2009-08-12 18:33:39 -0700122 int checkUidSignatures(int uid1, int uid2);
Svetoslavc6d1c342015-02-26 14:44:43 -0800123
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124 String[] getPackagesForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800125
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126 String getNameForUid(int uid);
Svetoslavc6d1c342015-02-26 14:44:43 -0800127
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800128 int getUidForSharedUser(String sharedUserName);
Ben Gruverdd72c9e2013-08-06 12:34:17 -0700129
130 int getFlagsForUid(int uid);
131
Alex Klyubinb9f8a522015-02-03 11:12:59 -0800132 int getPrivateFlagsForUid(int uid);
133
Dianne Hackborn2d7576b2014-10-03 16:26:04 -0700134 boolean isUidPrivileged(int uid);
135
Dianne Hackborn33f5ddd2014-07-21 15:35:45 -0700136 String[] getAppOpPermissionPackages(String permissionName);
137
Amith Yamasani483f3b02012-03-13 16:08:00 -0700138 ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139
Nicolas Prevot81948992014-05-16 18:25:26 +0100140 boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000141
Svetoslavc6d1c342015-02-26 14:44:43 -0800142 List<ResolveInfo> queryIntentActivities(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700143 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144
145 List<ResolveInfo> queryIntentActivityOptions(
146 in ComponentName caller, in Intent[] specifics,
147 in String[] specificTypes, in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700148 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800149
150 List<ResolveInfo> queryIntentReceivers(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700151 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152
153 ResolveInfo resolveService(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700154 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800155
156 List<ResolveInfo> queryIntentServices(in Intent intent,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700157 String resolvedType, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800158
Jeff Sharkey85f5f812013-10-07 10:16:12 -0700159 List<ResolveInfo> queryIntentContentProviders(in Intent intent,
160 String resolvedType, int flags, int userId);
161
Kenny Root0e2c0f32011-04-15 17:50:10 -0700162 /**
163 * This implements getInstalledPackages via a "last returned row"
164 * mechanism that is not exposed in the API. This is to get around the IPC
165 * limit that kicks in when flags are included that bloat up the data
166 * returned.
167 */
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800168 ParceledListSlice getInstalledPackages(int flags, in int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800169
Kenny Root0e2c0f32011-04-15 17:50:10 -0700170 /**
Dianne Hackborne7991752013-01-16 17:56:46 -0800171 * This implements getPackagesHoldingPermissions via a "last returned row"
172 * mechanism that is not exposed in the API. This is to get around the IPC
173 * limit that kicks in when flags are included that bloat up the data
174 * returned.
175 */
176 ParceledListSlice getPackagesHoldingPermissions(in String[] permissions,
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800177 int flags, int userId);
Dianne Hackborne7991752013-01-16 17:56:46 -0800178
179 /**
Kenny Root0e2c0f32011-04-15 17:50:10 -0700180 * This implements getInstalledApplications via a "last returned row"
181 * mechanism that is not exposed in the API. This is to get around the IPC
182 * limit that kicks in when flags are included that bloat up the data
183 * returned.
184 */
Dianne Hackbornd8e1dbb2013-01-17 17:47:37 -0800185 ParceledListSlice getInstalledApplications(int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800186
187 /**
188 * Retrieve all applications that are marked as persistent.
Svetoslavc6d1c342015-02-26 14:44:43 -0800189 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800190 * @return A List&lt;applicationInfo> containing one entry for each persistent
191 * application.
192 */
193 List<ApplicationInfo> getPersistentApplications(int flags);
194
Amith Yamasani483f3b02012-03-13 16:08:00 -0700195 ProviderInfo resolveContentProvider(String name, int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800196
197 /**
198 * Retrieve sync information for all content providers.
Svetoslavc6d1c342015-02-26 14:44:43 -0800199 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800200 * @param outNames Filled in with a list of the root names of the content
201 * providers that can sync.
202 * @param outInfo Filled in with a list of the ProviderInfo for each
203 * name in 'outNames'.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800204 */
205 void querySyncProviders(inout List<String> outNames,
206 inout List<ProviderInfo> outInfo);
207
Dianne Hackborn28ec27c2015-08-03 15:28:28 -0700208 ParceledListSlice queryContentProviders(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800209 String processName, int uid, int flags);
210
211 InstrumentationInfo getInstrumentationInfo(
212 in ComponentName className, int flags);
213
214 List<InstrumentationInfo> queryInstrumentation(
215 String targetPackage, int flags);
216
Todd Kennedy5cbeb592016-02-24 22:45:00 +0000217 void installPackage(in String originPath,
218 in IPackageInstallObserver2 observer,
219 int flags,
220 in String installerPackageName,
221 in VerificationParams verificationParams,
222 in String packageAbiOverride);
223
Amith Yamasanidda003f2014-08-28 18:06:51 -0700224 void installPackageAsUser(in String originPath,
225 in IPackageInstallObserver2 observer,
226 int flags,
227 in String installerPackageName,
Todd Kennedy5cbeb592016-02-24 22:45:00 +0000228 in VerificationParams verificationParams,
229 in String packageAbiOverride,
Amith Yamasanidda003f2014-08-28 18:06:51 -0700230 int userId);
231
Christopher Tate1bb69062010-02-19 17:02:12 -0800232 void finishPackageInstall(int token);
233
Dianne Hackborn880119b2010-11-18 22:26:40 -0800234 void setInstallerPackageName(in String targetPackage, in String installerPackageName);
235
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700236 /** @deprecated rawr, don't call AIDL methods directly! */
237 void deletePackageAsUser(in String packageName, IPackageDeleteObserver observer,
238 int userId, int flags);
239
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800240 /**
Amith Yamasani67df64b2012-12-14 12:09:36 -0800241 * Delete a package for a specific user.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800242 *
243 * @param packageName The fully qualified name of the package to delete.
244 * @param observer a callback to use to notify when the package deletion in finished.
Amith Yamasani67df64b2012-12-14 12:09:36 -0800245 * @param userId the id of the user for whom to delete the package
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800246 * @param flags - possible values: {@link #DONT_DELETE_DATA}
247 */
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -0700248 void deletePackage(in String packageName, IPackageDeleteObserver2 observer, int userId, int flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800249
Jacek Surazski65e13172009-04-28 15:26:38 +0200250 String getInstallerPackageName(in String packageName);
251
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800252 void addPackageToPreferred(String packageName);
Amith Yamasani67df64b2012-12-14 12:09:36 -0800253
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800254 void removePackageFromPreferred(String packageName);
Amith Yamasani67df64b2012-12-14 12:09:36 -0800255
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800256 List<PackageInfo> getPreferredPackages(int flags);
257
Svet Ganov9c8b8ab2015-07-23 09:32:26 -0700258 void resetApplicationPreferences(int userId);
Dianne Hackborn8a2ed1d2013-01-29 15:18:29 -0800259
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700260 ResolveInfo getLastChosenActivity(in Intent intent,
261 String resolvedType, int flags);
262
263 void setLastChosenActivity(in Intent intent, String resolvedType, int flags,
264 in IntentFilter filter, int match, in ComponentName activity);
265
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800266 void addPreferredActivity(in IntentFilter filter, int match,
Amith Yamasania3f133a2012-08-09 17:11:28 -0700267 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100268
269 void replacePreferredActivity(in IntentFilter filter, int match,
Amith Yamasani41c1ded2014-08-05 11:15:05 -0700270 in ComponentName[] set, in ComponentName activity, int userId);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100271
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800272 void clearPackagePreferredActivities(String packageName);
Satish Sampath8dbe6122009-06-02 23:35:54 +0100273
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800274 int getPreferredActivities(out List<IntentFilter> outFilters,
275 out List<ComponentName> outActivities, String packageName);
Amith Yamasanie9ecc8b2013-08-22 11:16:27 -0700276
Sander Alewijnsef475ca32014-02-17 15:13:58 +0000277 void addPersistentPreferredActivity(in IntentFilter filter, in ComponentName activity, int userId);
278
279 void clearPackagePersistentPreferredActivities(String packageName, int userId);
280
Nicolas Prevot3f7777f2014-07-24 15:58:39 +0100281 void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000282 int sourceUserId, int targetUserId, int flags);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000283
Nicolas Prevot4b8d5822015-03-05 15:20:49 +0000284 void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage);
Nicolas Prevot10fa67c2014-03-24 13:44:38 +0000285
Andrei Stingaceanueb84b182016-01-26 18:39:55 +0000286 String[] setPackagesSuspendedAsUser(in String[] packageNames, boolean suspended, int userId);
Andrei Stingaceanu355b2322016-02-12 16:43:51 +0000287 boolean isPackageSuspendedForUser(String packageName, int userId);
Andrei Stingaceanu1e283912015-11-26 15:26:28 +0000288
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800289 /**
Christopher Tatee012a232015-04-01 17:18:50 -0700290 * Backup/restore support - only the system uid may use these.
291 */
292 byte[] getPreferredActivityBackup(int userId);
293 void restorePreferredActivities(in byte[] backup, int userId);
Christopher Tate6038d152015-06-17 13:07:46 -0700294 byte[] getDefaultAppsBackup(int userId);
295 void restoreDefaultApps(in byte[] backup, int userId);
296 byte[] getIntentFilterVerificationBackup(int userId);
297 void restoreIntentFilterVerification(in byte[] backup, int userId);
Christopher Tatee9fd1fa2015-09-15 16:43:07 -0700298 byte[] getPermissionGrantBackup(int userId);
299 void restorePermissionGrants(in byte[] backup, int userId);
Christopher Tatee012a232015-04-01 17:18:50 -0700300
301 /**
Christopher Tatea2a0850d2013-09-05 16:38:58 -0700302 * Report the set of 'Home' activity candidates, plus (if any) which of them
303 * is the current "always use this one" setting.
304 */
305 ComponentName getHomeActivities(out List<ResolveInfo> outHomeCandidates);
306
307 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800308 * As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.
309 */
310 void setComponentEnabledSetting(in ComponentName componentName,
Amith Yamasani483f3b02012-03-13 16:08:00 -0700311 in int newState, in int flags, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800312
313 /**
314 * As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.
315 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700316 int getComponentEnabledSetting(in ComponentName componentName, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700317
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800318 /**
319 * As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.
320 */
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -0700321 void setApplicationEnabledSetting(in String packageName, in int newState, int flags,
322 int userId, String callingPackage);
Jeff Davidson2a880312015-06-22 16:54:34 -0700323
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800324 /**
325 * As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.
326 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700327 int getApplicationEnabledSetting(in String packageName, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700328
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800329 /**
Dianne Hackborne7f97212011-02-24 14:40:20 -0800330 * Set whether the given package should be considered stopped, making
331 * it not visible to implicit intents that filter out stopped packages.
332 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700333 void setPackageStoppedState(String packageName, boolean stopped, int userId);
Dianne Hackborne7f97212011-02-24 14:40:20 -0800334
335 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800336 * Free storage by deleting LRU sorted list of cache files across
337 * all applications. If the currently available free storage
338 * on the device is greater than or equal to the requested
339 * free storage, no cache files are cleared. If the currently
340 * available storage on the device is less than the requested
341 * free storage, some or all of the cache files across
342 * all applications are deleted (based on last accessed time)
343 * to increase the free storage space on the device to
344 * the requested value. There is no guarantee that clearing all
345 * the cache files from all applications will clear up
346 * enough storage to achieve the desired value.
347 * @param freeStorageSize The number of bytes of storage to be
348 * freed by the system. Say if freeStorageSize is XX,
349 * and the current free storage is YY,
350 * if XX is less than YY, just return. if not free XX-YY number
351 * of bytes if possible.
352 * @param observer call back used to notify when
353 * the operation is completed
354 */
Jeff Sharkey529f91f2015-04-18 20:23:13 -0700355 void freeStorageAndNotify(in String volumeUuid, in long freeStorageSize,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 IPackageDataObserver observer);
357
358 /**
359 * Free storage by deleting LRU sorted list of cache files across
360 * all applications. If the currently available free storage
361 * on the device is greater than or equal to the requested
362 * free storage, no cache files are cleared. If the currently
363 * available storage on the device is less than the requested
364 * free storage, some or all of the cache files across
365 * all applications are deleted (based on last accessed time)
366 * to increase the free storage space on the device to
367 * the requested value. There is no guarantee that clearing all
368 * the cache files from all applications will clear up
369 * enough storage to achieve the desired value.
370 * @param freeStorageSize The number of bytes of storage to be
371 * freed by the system. Say if freeStorageSize is XX,
372 * and the current free storage is YY,
373 * if XX is less than YY, just return. if not free XX-YY number
374 * of bytes if possible.
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700375 * @param pi IntentSender call back used to
376 * notify when the operation is completed.May be null
377 * to indicate that no call back is desired.
378 */
Jeff Sharkey529f91f2015-04-18 20:23:13 -0700379 void freeStorage(in String volumeUuid, in long freeStorageSize,
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -0700380 in IntentSender pi);
Jeff Davidson2a880312015-06-22 16:54:34 -0700381
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800382 /**
383 * Delete all the cache files in an applications cache directory
384 * @param packageName The package name of the application whose cache
385 * files need to be deleted
386 * @param observer a callback used to notify when the deletion is finished.
387 */
388 void deleteApplicationCacheFiles(in String packageName, IPackageDataObserver observer);
Jeff Davidson2a880312015-06-22 16:54:34 -0700389
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800390 /**
391 * Clear the user data directory of an application.
392 * @param packageName The package name of the application whose cache
393 * files need to be deleted
394 * @param observer a callback used to notify when the operation is completed.
395 */
Amith Yamasani483f3b02012-03-13 16:08:00 -0700396 void clearApplicationUserData(in String packageName, IPackageDataObserver observer, int userId);
Jeff Davidson2a880312015-06-22 16:54:34 -0700397
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 /**
399 * Get package statistics including the code, data and cache size for
400 * an already installed package
401 * @param packageName The package name of the application
Dianne Hackborn0c380492012-08-20 17:23:30 -0700402 * @param userHandle Which user the size should be retrieved for
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800403 * @param observer a callback to use to notify when the asynchronous
404 * retrieval of information is complete.
405 */
Dianne Hackborn0c380492012-08-20 17:23:30 -0700406 void getPackageSizeInfo(in String packageName, int userHandle, IPackageStatsObserver observer);
Jeff Davidson2a880312015-06-22 16:54:34 -0700407
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800408 /**
409 * Get a list of shared libraries that are available on the
410 * system.
411 */
412 String[] getSystemSharedLibraryNames();
413
Dianne Hackborn49237342009-08-27 20:08:01 -0700414 /**
415 * Get a list of features that are available on the
416 * system.
417 */
418 FeatureInfo[] getSystemAvailableFeatures();
419
Jeff Sharkey115d2c12016-02-15 17:25:57 -0700420 boolean hasSystemFeature(String name, int version);
Jeff Davidson2a880312015-06-22 16:54:34 -0700421
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800422 void enterSafeMode();
423 boolean isSafeMode();
424 void systemReady();
425 boolean hasSystemUidErrors();
Dianne Hackborn661cd522011-08-22 00:26:20 -0700426
427 /**
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000428 * Ask the package manager to fstrim the disk if needed.
Dianne Hackborn661cd522011-08-22 00:26:20 -0700429 */
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000430 void performFstrimIfNeeded();
431
432 /**
David Brazdila0e10432016-01-20 14:04:40 +0000433 * Ask the package manager to extract packages if needed, to save
434 * the VM unzipping the APK in memory during launch.
435 */
436 void extractPackagesIfNeeded();
437
438 /**
Nicolas Geoffray27c07372015-11-05 16:54:09 +0000439 * Notify the package manager that a package is going to be used.
440 */
441 void notifyPackageUse(String packageName);
Dianne Hackborn661cd522011-08-22 00:26:20 -0700442
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700443 /**
444 * Ask the package manager to perform dex-opt (if needed) on the given
Narayan Kamath20531682014-07-14 13:18:43 +0100445 * package and for the given instruction set if it already hasn't done
446 * so.
447 *
448 * If the supplied instructionSet is null, the package manager will use
449 * the packages default instruction set.
450 *
451 * In most cases, apps are dexopted in advance and this function will
452 * be a no-op.
Dianne Hackborn5c1e00b2009-06-18 17:10:57 -0700453 */
Narayan Kamath20531682014-07-14 13:18:43 +0100454 boolean performDexOptIfNeeded(String packageName, String instructionSet);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800455
David Brazdil493411a2016-02-01 13:48:46 +0000456 boolean performDexOpt(String packageName, String instructionSet, boolean useProfiles,
457 boolean extractOnly, boolean force);
458
Jeff Sharkey20e0c502014-07-25 14:09:37 -0700459 void forceDexOpt(String packageName);
460
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800461 /**
462 * Update status of external media on the package manager to scan and
463 * install packages installed on the external media. Like say the
464 * MountService uses this to call into the package manager to update
465 * status of sdcard.
466 */
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -0700467 void updateExternalMediaStatus(boolean mounted, boolean reportStatus);
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800468
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700469 PackageCleanItem nextPackageToClean(in PackageCleanItem lastPackage);
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800470
Jeff Sharkey620b32b2015-04-23 19:36:02 -0700471 int getMoveStatus(int moveId);
472
473 void registerMoveCallback(in IPackageMoveObserver callback);
474 void unregisterMoveCallback(in IPackageMoveObserver callback);
475
476 int movePackage(in String packageName, in String volumeUuid);
477 int movePrimaryStorage(in String volumeUuid);
Jeff Sharkeyb2b9ab82015-04-05 21:10:42 -0700478
Dianne Hackbornd7c09682010-03-30 10:42:20 -0700479 boolean addPermissionAsync(in PermissionInfo info);
Suchi Amalapurapu40e47252010-04-07 16:15:50 -0700480
481 boolean setInstallLocation(int loc);
482 int getInstallLocation();
Amith Yamasani0b285492011-04-14 17:35:23 -0700483
Amith Yamasani67df64b2012-12-14 12:09:36 -0800484 int installExistingPackageAsUser(String packageName, int userId);
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700485
Kenny Root3a9b5fb2011-09-20 14:15:38 -0700486 void verifyPendingInstall(int id, int verificationCode);
rich canningsd9ef3e52012-08-22 14:28:05 -0700487 void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay);
Kenny Root0aaa0d92011-09-12 16:42:55 -0700488
Fabrice Di Megliod3d8a322015-04-01 15:58:47 -0700489 void verifyIntentFilter(int id, int verificationCode, in List<String> failedDomains);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800490 int getIntentVerificationStatus(String packageName, int userId);
491 boolean updateIntentVerificationStatus(String packageName, int status, int userId);
492 List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName);
Fabrice Di Meglio07885952015-04-06 19:41:28 -0700493 List<IntentFilter> getAllIntentFilters(String packageName);
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -0800494
Fabrice Di Meglio62271722015-04-10 17:24:02 -0700495 boolean setDefaultBrowserPackageName(String packageName, int userId);
496 String getDefaultBrowserPackageName(int userId);
497
Kenny Root0aaa0d92011-09-12 16:42:55 -0700498 VerifierDeviceIdentity getVerifierDeviceIdentity();
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700499
500 boolean isFirstBoot();
Dianne Hackborn13579ed2012-11-28 18:05:36 -0800501 boolean isOnlyCoreApps();
Jeff Hao9f60c082014-10-28 18:51:07 -0700502 boolean isUpgrade();
Amith Yamasani742a6712011-05-04 14:49:28 -0700503
Jeff Sharkey5d32e772012-04-12 15:59:23 -0700504 void setPermissionEnforced(String permission, boolean enforced);
505 boolean isPermissionEnforced(String permission);
Jeff Sharkeyf6f7f1d2012-06-12 17:12:08 -0700506
507 /** Reflects current DeviceStorageMonitorService state */
508 boolean isStorageLow();
Amith Yamasani655d0e22013-06-12 14:19:10 -0700509
Amith Yamasanie5bcff62014-07-19 15:44:09 -0700510 boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId);
511 boolean getApplicationHiddenSettingAsUser(String packageName, int userId);
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -0700512
513 IPackageInstaller getPackageInstaller();
Kenny Guyc13053b2014-05-29 14:17:17 +0100514
515 boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId);
516 boolean getBlockUninstallForUser(String packageName, int userId);
dcashman9d2f4412014-06-09 09:27:54 -0700517
dcashmanc6f22492014-08-14 09:54:51 -0700518 KeySet getKeySetByAlias(String packageName, String alias);
519 KeySet getSigningKeySet(String packageName);
520 boolean isPackageSignedByKeySet(String packageName, in KeySet ks);
521 boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks);
Svetoslavf7c06eb2015-06-10 18:43:22 -0700522
523 void addOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
524 void removeOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
Svetoslavcdfd2302015-06-25 19:07:31 -0700525 void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
Svet Ganovad3b2972015-07-07 22:49:17 -0700526
527 boolean isPermissionRevokedByPolicy(String permission, String packageName, int userId);
Svet Ganovf1b7f202015-07-29 08:33:42 -0700528
529 String getPermissionControllerPackageName();
Svet Ganov2acf0632015-11-24 19:10:59 -0800530
531 ParceledListSlice getEphemeralApplications(int userId);
532 byte[] getEphemeralApplicationCookie(String packageName, int userId);
533 boolean setEphemeralApplicationCookie(String packageName, in byte[] cookie, int userId);
534 Bitmap getEphemeralApplicationIcon(String packageName, int userId);
535 boolean isEphemeralApplication(String packageName, int userId);
Fyodor Kupolovbdbc9692015-12-14 13:11:13 -0800536
537 boolean setRequiredForSystemUser(String packageName, boolean systemUserApp);
Svet Ganovd7b1f4112016-02-09 18:49:23 -0800538
539 String getServicesSystemSharedLibraryPackageName();
Makoto Onukif34db0a2016-02-17 11:17:15 -0800540
541 boolean isPackageDeviceAdminOnAnyUser(String packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800542}