FileDocCategorySizeDatePackage
IPackageManager.javaAPI DocAndroid 5.1 API154739Sat Mar 14 05:48:00 GMT 2015android.content.pm

IPackageManager

public interface IPackageManager implements android.os.IInterface
See {@link PackageManager} for documentation on most of the APIs here. {@hide}

Fields Summary
Constructors Summary
Methods Summary
public booleanactivitySupportsIntent(android.content.ComponentName className, android.content.Intent intent, java.lang.String resolvedType)

public voidaddCrossProfileIntentFilter(android.content.IntentFilter intentFilter, java.lang.String ownerPackage, int ownerUserId, int sourceUserId, int targetUserId, int flags)

public voidaddPackageToPreferred(java.lang.String packageName)

public booleanaddPermission(android.content.pm.PermissionInfo info)

public booleanaddPermissionAsync(android.content.pm.PermissionInfo info)

public voidaddPersistentPreferredActivity(android.content.IntentFilter filter, android.content.ComponentName activity, int userId)

public voidaddPreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity, int userId)

public booleancanForwardTo(android.content.Intent intent, java.lang.String resolvedType, int sourceUserId, int targetUserId)

public java.lang.String[]canonicalToCurrentPackageNames(java.lang.String[] names)

public intcheckPermission(java.lang.String permName, java.lang.String pkgName)

public intcheckSignatures(java.lang.String pkg1, java.lang.String pkg2)

public intcheckUidPermission(java.lang.String permName, int uid)

public intcheckUidSignatures(int uid1, int uid2)

public voidclearApplicationUserData(java.lang.String packageName, android.content.pm.IPackageDataObserver observer, int userId)
Clear the user data directory of an application.

param
packageName The package name of the application whose cache files need to be deleted
param
observer a callback used to notify when the operation is completed.

public voidclearCrossProfileIntentFilters(int sourceUserId, java.lang.String ownerPackage, int ownerUserId)

public voidclearPackagePersistentPreferredActivities(java.lang.String packageName, int userId)

public voidclearPackagePreferredActivities(java.lang.String packageName)

public java.lang.String[]currentToCanonicalPackageNames(java.lang.String[] names)

public voiddeleteApplicationCacheFiles(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)
Delete all the cache files in an applications cache directory

param
packageName The package name of the application whose cache files need to be deleted
param
observer a callback used to notify when the deletion is finished.

public voiddeletePackage(java.lang.String packageName, android.content.pm.IPackageDeleteObserver2 observer, int userId, int flags)
Delete a package for a specific user.

param
packageName The fully qualified name of the package to delete.
param
observer a callback to use to notify when the package deletion in finished.
param
userId the id of the user for whom to delete the package
param
flags - possible values: {@link #DONT_DELETE_DATA}

public voiddeletePackageAsUser(java.lang.String packageName, android.content.pm.IPackageDeleteObserver observer, int userId, int flags)

deprecated
rawr, don't call AIDL methods directly!

public voidenterSafeMode()

public voidextendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)

public voidfinishPackageInstall(int token)

public voidforceDexOpt(java.lang.String packageName)

public voidfreeStorage(long freeStorageSize, android.content.IntentSender pi)
Free storage by deleting LRU sorted list of cache files across all applications. If the currently available free storage on the device is greater than or equal to the requested free storage, no cache files are cleared. If the currently available storage on the device is less than the requested free storage, some or all of the cache files across all applications are deleted (based on last accessed time) to increase the free storage space on the device to the requested value. There is no guarantee that clearing all the cache files from all applications will clear up enough storage to achieve the desired value.

param
freeStorageSize The number of bytes of storage to be freed by the system. Say if freeStorageSize is XX, and the current free storage is YY, if XX is less than YY, just return. if not free XX-YY number of bytes if possible.
param
pi IntentSender call back used to notify when the operation is completed.May be null to indicate that no call back is desired.

public voidfreeStorageAndNotify(long freeStorageSize, android.content.pm.IPackageDataObserver observer)
Free storage by deleting LRU sorted list of cache files across all applications. If the currently available free storage on the device is greater than or equal to the requested free storage, no cache files are cleared. If the currently available storage on the device is less than the requested free storage, some or all of the cache files across all applications are deleted (based on last accessed time) to increase the free storage space on the device to the requested value. There is no guarantee that clearing all the cache files from all applications will clear up enough storage to achieve the desired value.

param
freeStorageSize The number of bytes of storage to be freed by the system. Say if freeStorageSize is XX, and the current free storage is YY, if XX is less than YY, just return. if not free XX-YY number of bytes if possible.
param
observer call back used to notify when the operation is completed

public android.content.pm.ActivityInfogetActivityInfo(android.content.ComponentName className, int flags, int userId)

public java.util.ListgetAllPermissionGroups(int flags)

public java.lang.String[]getAppOpPermissionPackages(java.lang.String permissionName)

public intgetApplicationEnabledSetting(java.lang.String packageName, int userId)
As per {@link android.content.pm.PackageManager#getApplicationEnabledSetting}.

public booleangetApplicationHiddenSettingAsUser(java.lang.String packageName, int userId)

public android.content.pm.ApplicationInfogetApplicationInfo(java.lang.String packageName, int flags, int userId)

public booleangetBlockUninstallForUser(java.lang.String packageName, int userId)

public intgetComponentEnabledSetting(android.content.ComponentName componentName, int userId)
As per {@link android.content.pm.PackageManager#getComponentEnabledSetting}.

public intgetFlagsForUid(int uid)

public android.content.ComponentNamegetHomeActivities(java.util.List outHomeCandidates)
Report the set of 'Home' activity candidates, plus (if any) which of them is the current "always use this one" setting.

public intgetInstallLocation()

public android.content.pm.ParceledListSlicegetInstalledApplications(int flags, int userId)
This implements getInstalledApplications via a "last returned row" mechanism that is not exposed in the API. This is to get around the IPC limit that kicks in when flags are included that bloat up the data returned.

public android.content.pm.ParceledListSlicegetInstalledPackages(int flags, int userId)
This implements getInstalledPackages via a "last returned row" mechanism that is not exposed in the API. This is to get around the IPC limit that kicks in when flags are included that bloat up the data returned.

public java.lang.StringgetInstallerPackageName(java.lang.String packageName)

public android.content.pm.InstrumentationInfogetInstrumentationInfo(android.content.ComponentName className, int flags)

public android.content.pm.KeySetgetKeySetByAlias(java.lang.String packageName, java.lang.String alias)

public android.content.pm.ResolveInfogetLastChosenActivity(android.content.Intent intent, java.lang.String resolvedType, int flags)

public java.lang.StringgetNameForUid(int uid)

public int[]getPackageGids(java.lang.String packageName)

public android.content.pm.PackageInfogetPackageInfo(java.lang.String packageName, int flags, int userId)

public android.content.pm.IPackageInstallergetPackageInstaller()

public voidgetPackageSizeInfo(java.lang.String packageName, int userHandle, android.content.pm.IPackageStatsObserver observer)
Get package statistics including the code, data and cache size for an already installed package

param
packageName The package name of the application
param
userHandle Which user the size should be retrieved for
param
observer a callback to use to notify when the asynchronous retrieval of information is complete.

public intgetPackageUid(java.lang.String packageName, int userId)

public java.lang.String[]getPackagesForUid(int uid)

public android.content.pm.ParceledListSlicegetPackagesHoldingPermissions(java.lang.String[] permissions, int flags, int userId)
This implements getPackagesHoldingPermissions via a "last returned row" mechanism that is not exposed in the API. This is to get around the IPC limit that kicks in when flags are included that bloat up the data returned.

public android.content.pm.PermissionGroupInfogetPermissionGroupInfo(java.lang.String name, int flags)

public android.content.pm.PermissionInfogetPermissionInfo(java.lang.String name, int flags)

public java.util.ListgetPersistentApplications(int flags)
Retrieve all applications that are marked as persistent.

return
A List<applicationInfo> containing one entry for each persistent application.

public intgetPreferredActivities(java.util.List outFilters, java.util.List outActivities, java.lang.String packageName)

public java.util.ListgetPreferredPackages(int flags)

public android.content.pm.ProviderInfogetProviderInfo(android.content.ComponentName className, int flags, int userId)

public android.content.pm.ActivityInfogetReceiverInfo(android.content.ComponentName className, int flags, int userId)

public android.content.pm.ServiceInfogetServiceInfo(android.content.ComponentName className, int flags, int userId)

public android.content.pm.KeySetgetSigningKeySet(java.lang.String packageName)

public android.content.pm.FeatureInfo[]getSystemAvailableFeatures()
Get a list of features that are available on the system.

public java.lang.String[]getSystemSharedLibraryNames()
Get a list of shared libraries that are available on the system.

public intgetUidForSharedUser(java.lang.String sharedUserName)

public android.content.pm.VerifierDeviceIdentitygetVerifierDeviceIdentity()

public voidgrantPermission(java.lang.String packageName, java.lang.String permissionName)

public booleanhasSystemFeature(java.lang.String name)

public booleanhasSystemUidErrors()

public intinstallExistingPackageAsUser(java.lang.String packageName, int userId)

public voidinstallPackage(java.lang.String originPath, android.content.pm.IPackageInstallObserver2 observer, int flags, java.lang.String installerPackageName, android.content.pm.VerificationParams verificationParams, java.lang.String packageAbiOverride)

public voidinstallPackageAsUser(java.lang.String originPath, android.content.pm.IPackageInstallObserver2 observer, int flags, java.lang.String installerPackageName, android.content.pm.VerificationParams verificationParams, java.lang.String packageAbiOverride, int userId)

public booleanisFirstBoot()

public booleanisOnlyCoreApps()

public booleanisPackageAvailable(java.lang.String packageName, int userId)

public booleanisPackageSignedByKeySet(java.lang.String packageName, android.content.pm.KeySet ks)

public booleanisPackageSignedByKeySetExactly(java.lang.String packageName, android.content.pm.KeySet ks)

public booleanisPermissionEnforced(java.lang.String permission)

public booleanisProtectedBroadcast(java.lang.String actionName)

public booleanisSafeMode()

public booleanisStorageLow()
Reflects current DeviceStorageMonitorService state

public booleanisUidPrivileged(int uid)

public booleanisUpgrade()

public voidmovePackage(java.lang.String packageName, android.content.pm.IPackageMoveObserver observer, int flags)

public android.content.pm.PackageCleanItemnextPackageToClean(android.content.pm.PackageCleanItem lastPackage)

public voidperformBootDexOpt()
Ask the package manager to perform boot-time dex-opt of all existing packages.

public booleanperformDexOptIfNeeded(java.lang.String packageName, java.lang.String instructionSet)
Ask the package manager to perform dex-opt (if needed) on the given package and for the given instruction set if it already hasn't done so. If the supplied instructionSet is null, the package manager will use the packages default instruction set. In most cases, apps are dexopted in advance and this function will be a no-op.

public java.util.ListqueryContentProviders(java.lang.String processName, int uid, int flags)

public java.util.ListqueryInstrumentation(java.lang.String targetPackage, int flags)

public java.util.ListqueryIntentActivities(android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public java.util.ListqueryIntentActivityOptions(android.content.ComponentName caller, android.content.Intent[] specifics, java.lang.String[] specificTypes, android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public java.util.ListqueryIntentContentProviders(android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public java.util.ListqueryIntentReceivers(android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public java.util.ListqueryIntentServices(android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public java.util.ListqueryPermissionsByGroup(java.lang.String group, int flags)

public voidquerySyncProviders(java.util.List outNames, java.util.List outInfo)
Retrieve sync information for all content providers.

param
outNames Filled in with a list of the root names of the content providers that can sync.
param
outInfo Filled in with a list of the ProviderInfo for each name in 'outNames'.

public voidremovePackageFromPreferred(java.lang.String packageName)

public voidremovePermission(java.lang.String name)

public voidreplacePreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity, int userId)

public voidresetPreferredActivities(int userId)

public android.content.pm.ProviderInforesolveContentProvider(java.lang.String name, int flags, int userId)

public android.content.pm.ResolveInforesolveIntent(android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public android.content.pm.ResolveInforesolveService(android.content.Intent intent, java.lang.String resolvedType, int flags, int userId)

public voidrevokePermission(java.lang.String packageName, java.lang.String permissionName)

public voidsetApplicationEnabledSetting(java.lang.String packageName, int newState, int flags, int userId, java.lang.String callingPackage)
As per {@link android.content.pm.PackageManager#setApplicationEnabledSetting}.

public booleansetApplicationHiddenSettingAsUser(java.lang.String packageName, boolean hidden, int userId)

public booleansetBlockUninstallForUser(java.lang.String packageName, boolean blockUninstall, int userId)

public voidsetComponentEnabledSetting(android.content.ComponentName componentName, int newState, int flags, int userId)
As per {@link android.content.pm.PackageManager#setComponentEnabledSetting}.

public booleansetInstallLocation(int loc)

public voidsetInstallerPackageName(java.lang.String targetPackage, java.lang.String installerPackageName)

public voidsetLastChosenActivity(android.content.Intent intent, java.lang.String resolvedType, int flags, android.content.IntentFilter filter, int match, android.content.ComponentName activity)

public voidsetPackageStoppedState(java.lang.String packageName, boolean stopped, int userId)
Set whether the given package should be considered stopped, making it not visible to implicit intents that filter out stopped packages.

public voidsetPermissionEnforced(java.lang.String permission, boolean enforced)

public voidsystemReady()

public voidupdateExternalMediaStatus(boolean mounted, boolean reportStatus)
Update status of external media on the package manager to scan and install packages installed on the external media. Like say the MountService uses this to call into the package manager to update status of sdcard.

public voidverifyPendingInstall(int id, int verificationCode)