Package org.robolectric.shadows
Class ShadowApplicationPackageManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowPackageManager
-
- org.robolectric.shadows.ShadowApplicationPackageManager
-
@Implements(value=android.app.ApplicationPackageManager.class, isInAndroidSdk=false, looseSignatures=true) public class ShadowApplicationPackageManager extends ShadowPackageManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowPackageManager
ShadowPackageManager.ComponentState, ShadowPackageManager.IntentComparator, ShadowPackageManager.PackageSetting
-
-
Field Summary
-
Fields inherited from class org.robolectric.shadows.ShadowPackageManager
resources
-
-
Constructor Summary
Constructors Constructor Description ShadowApplicationPackageManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCrossProfileIntentFilter(android.content.IntentFilter filter, int sourceUserId, int targetUserId, int flags)protected voidaddOnPermissionsChangeListener(java.lang.Object listener)protected voidaddPackageToPreferred(java.lang.String packageName)protected booleanaddPermission(android.content.pm.PermissionInfo info)protected booleanaddPermissionAsync(android.content.pm.PermissionInfo info)voidaddPreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)protected java.lang.String[]canonicalToCurrentPackageNames(java.lang.String[] names)protected booleancanRequestPackageInstalls()protected intcheckPermission(java.lang.String permName, java.lang.String pkgName)protected intcheckSignatures(int uid1, int uid2)protected intcheckSignatures(java.lang.String pkg1, java.lang.String pkg2)protected voidclearApplicationUserData(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)protected voidclearCrossProfileIntentFilters(int sourceUserId)protected voidclearPackagePreferredActivities(java.lang.String packageName)protected java.lang.String[]currentToCanonicalPackageNames(java.lang.String[] names)protected voiddeleteApplicationCacheFiles(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)protected voiddeleteApplicationCacheFilesAsUser(java.lang.String packageName, int userId, android.content.pm.IPackageDataObserver observer)protected voiddeletePackage(java.lang.String packageName, android.content.pm.IPackageDeleteObserver observer, int flags)protected voiddeletePackageAsUser(java.lang.String packageName, android.content.pm.IPackageDeleteObserver observer, int flags, int userId)protected voidextendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)protected voidflushPackageRestrictionsAsUser(int userId)protected voidfreeStorage(java.lang.String volumeUuid, long freeStorageSize, android.content.IntentSender pi)protected voidfreeStorageAndNotify(long freeStorageSize, android.content.pm.IPackageDataObserver observer)protected voidfreeStorageAndNotify(java.lang.String volumeUuid, long freeStorageSize, android.content.pm.IPackageDataObserver observer)protected android.graphics.drawable.DrawablegetActivityIcon(android.content.ComponentName activityName)protected android.content.pm.ActivityInfogetActivityInfo(android.content.ComponentName component, int flags)protected java.util.List<android.content.IntentFilter>getAllIntentFilters(java.lang.String packageName)protected java.util.List<android.content.pm.PermissionGroupInfo>getAllPermissionGroups(int flags)protected intgetApplicationEnabledSetting(java.lang.String packageName)protected booleangetApplicationHiddenSettingAsUser(java.lang.String packageName, android.os.UserHandle user)protected android.graphics.drawable.DrawablegetApplicationIcon(android.content.pm.ApplicationInfo info)protected android.graphics.drawable.DrawablegetApplicationIcon(java.lang.String packageName)protected android.content.pm.ApplicationInfogetApplicationInfo(java.lang.String packageName, int flags)protected java.lang.ObjectgetChangedPackages(int sequenceNumber)protected intgetComponentEnabledSetting(android.content.ComponentName componentName)protected android.graphics.drawable.DrawablegetDefaultActivityIcon()protected java.lang.StringgetDefaultBrowserPackageNameAsUser(int userId)protected android.graphics.drawable.DrawablegetDrawable(java.lang.String packageName, int resId, android.content.pm.ApplicationInfo appInfo)protected android.content.ComponentNamegetHomeActivities(java.util.List<android.content.pm.ResolveInfo> outActivities)protected java.util.List<android.content.pm.ApplicationInfo>getInstalledApplications(int flags)protected java.util.List<android.content.pm.ModuleInfo>getInstalledModules(int flags)java.util.List<android.content.pm.PackageInfo>getInstalledPackages(int flags)protected java.util.List<android.content.pm.PackageInfo>getInstalledPackagesAsUser(int flags, int userId)protected java.lang.StringgetInstallerPackageName(java.lang.String packageName)protected android.content.pm.InstrumentationInfogetInstrumentationInfo(android.content.ComponentName className, int flags)protected java.util.List<android.content.pm.IntentFilterVerificationInfo>getIntentFilterVerifications(java.lang.String packageName)protected intgetIntentVerificationStatusAsUser(java.lang.String packageName, int userId)protected java.lang.ObjectgetKeySetByAlias(java.lang.String packageName, java.lang.String alias)protected android.content.IntentgetLaunchIntentForPackage(java.lang.String packageName)protected android.content.IntentgetLeanbackLaunchIntentForPackage(java.lang.String packageName)protected java.lang.ObjectgetModuleInfo(java.lang.String packageName, int flags)protected intgetMoveStatus(int moveId)protected java.lang.StringgetNameForUid(int uid)protected java.util.List<android.os.storage.VolumeInfo>getPackageCandidateVolumes(android.content.pm.ApplicationInfo app)protected java.lang.ObjectgetPackageCurrentVolume(java.lang.Object app)protected int[]getPackageGids(java.lang.String packageName)protected int[]getPackageGids(java.lang.String packageName, int flags)protected android.content.pm.PackageInfogetPackageInfo(java.lang.String packageName, int flags)protected android.content.pm.PackageInfogetPackageInfoAsUser(java.lang.String packageName, int flags, int userId)protected java.lang.String[]getPackagesForUid(int uid)protected java.util.List<android.content.pm.PackageInfo>getPackagesHoldingPermissions(java.lang.String[] permissions, int flags)protected voidgetPackageSizeInfo(java.lang.Object pkgName, java.lang.Object observer)protected voidgetPackageSizeInfo(java.lang.Object pkgName, java.lang.Object uid, java.lang.Object observer)protected voidgetPackageSizeInfoAsUser(java.lang.Object pkgName, java.lang.Object uid, java.lang.Object observer)protected intgetPackageUid(java.lang.String packageName, int flags)protected intgetPackageUidAsUser(java.lang.String packageName, int userId)protected intgetPackageUidAsUser(java.lang.String packageName, int flags, int userId)protected java.lang.StringgetPermissionControllerPackageName()protected intgetPermissionFlags(java.lang.String permissionName, java.lang.String packageName, android.os.UserHandle user)protected android.content.pm.PermissionGroupInfogetPermissionGroupInfo(java.lang.String name, int flags)protected android.content.pm.PermissionInfogetPermissionInfo(java.lang.String name, int flags)intgetPreferredActivities(java.util.List<android.content.IntentFilter> outFilters, java.util.List<android.content.ComponentName> outActivities, java.lang.String packageName)protected java.util.List<android.content.pm.PackageInfo>getPreferredPackages(int flags)protected java.util.List<android.os.storage.VolumeInfo>getPrimaryStorageCandidateVolumes()protected java.lang.ObjectgetPrimaryStorageCurrentVolume()protected android.content.pm.ProviderInfogetProviderInfo(android.content.ComponentName component, int flags)protected android.content.pm.ActivityInfogetReceiverInfo(android.content.ComponentName component, int flags)protected android.content.res.ResourcesgetResourcesForActivity(android.content.ComponentName activityName)protected android.content.res.ResourcesgetResourcesForApplication(android.content.pm.ApplicationInfo applicationInfo)protected android.content.res.ResourcesgetResourcesForApplication(java.lang.String appPackageName)protected android.content.res.ResourcesgetResourcesForApplicationAsUser(java.lang.String appPackageName, int userId)protected android.content.pm.ServiceInfogetServiceInfo(android.content.ComponentName component, int flags)protected java.lang.StringgetServicesSystemSharedLibraryPackageName()protected java.lang.StringgetSharedSystemSharedLibraryPackageName()protected java.lang.ObjectgetSigningKeySet(java.lang.String packageName)protected android.content.pm.FeatureInfo[]getSystemAvailableFeatures()protected java.lang.String[]getSystemSharedLibraryNames()Returns all the values added viaShadowPackageManager.addSystemSharedLibraryName(String).java.lang.StringgetSystemTextClassifierPackageName()protected intgetUidForSharedUser(java.lang.String sharedUserName)protected java.lang.String[]getUnsuspendablePackages(java.lang.String[] packageNames)protected android.graphics.drawable.DrawablegetUserBadgedIcon(android.graphics.drawable.Drawable icon, android.os.UserHandle user)Adds a profile badge to the icon.protected android.graphics.drawable.DrawablegetUserBadgeForDensity(android.os.UserHandle userHandle, int i)protected android.content.pm.VerifierDeviceIdentitygetVerifierDeviceIdentity()protected voidgrantRuntimePermission(java.lang.String packageName, java.lang.String permissionName, android.os.UserHandle user)protected booleanhasSystemFeature(java.lang.String name)protected booleanhasSystemFeature(java.lang.String name, int version)protected intinstallExistingPackage(java.lang.String packageName)protected intinstallExistingPackageAsUser(java.lang.String packageName, int userId)protected voidinstallPackage(java.lang.Object packageURI, java.lang.Object observer, java.lang.Object flags, java.lang.Object installerPackageName)protected booleanisInstantApp(java.lang.String packageName)protected booleanisPackageAvailable(java.lang.String packageName)protected booleanisPackageSuspended(java.lang.String packageName)protected booleanisPackageSuspendedForUser(java.lang.String packageName, int userId)protected booleanisPermissionRevokedByPolicy(java.lang.String permName, java.lang.String pkgName)protected booleanisSafeMode()protected booleanisSignedBy(java.lang.String packageName, java.lang.Object ks)protected booleanisSignedByExactly(java.lang.String packageName, java.lang.Object ks)protected booleanisUpgrade()protected android.graphics.drawable.DrawableloadUnbadgedItemIcon(android.content.pm.PackageItemInfo itemInfo, android.content.pm.ApplicationInfo appInfo)Gets the unbadged icon based on the values set byShadowPackageManager.setUnbadgedApplicationIcon(java.lang.String, android.graphics.drawable.Drawable)or returns null if nothing has been set.protected java.lang.ObjectmovePackage(java.lang.Object packageName, java.lang.Object vol)protected java.lang.ObjectmovePrimaryStorage(java.lang.Object vol)protected java.util.List<android.content.pm.ResolveInfo>queryBroadcastReceivers(android.content.Intent intent, int flags)protected java.util.List<android.content.pm.ResolveInfo>queryBroadcastReceiversAsUser(android.content.Intent intent, int flags, int userId)protected java.util.List<android.content.pm.ProviderInfo>queryContentProviders(java.lang.String processName, int uid, int flags)protected java.util.List<android.content.pm.InstrumentationInfo>queryInstrumentation(java.lang.String targetPackage, int flags)protected java.util.List<android.content.pm.ResolveInfo>queryIntentActivities(android.content.Intent intent, int flags)protected java.util.List<android.content.pm.ResolveInfo>queryIntentActivitiesAsUser(android.content.Intent intent, int flags, int userId)Behaves asqueryIntentActivities(Intent, int)and currently ignores userId.protected java.util.List<android.content.pm.ResolveInfo>queryIntentActivityOptions(android.content.ComponentName caller, android.content.Intent[] specifics, android.content.Intent intent, int flags)protected java.util.List<android.content.pm.ResolveInfo>queryIntentContentProviders(android.content.Intent intent, int flags)protected java.util.List<android.content.pm.ResolveInfo>queryIntentContentProvidersAsUser(android.content.Intent intent, int flags, int userId)protected java.util.List<android.content.pm.ResolveInfo>queryIntentServices(android.content.Intent intent, int flags)protected java.util.List<android.content.pm.ResolveInfo>queryIntentServicesAsUser(android.content.Intent intent, int flags, int userId)Behaves asqueryIntentServices(Intent, int)and currently ignores userId.protected java.util.List<android.content.pm.PermissionInfo>queryPermissionsByGroup(java.lang.String group, int flags)protected voidregisterMoveCallback(java.lang.Object callback, java.lang.Object handler)protected voidremoveOnPermissionsChangeListener(java.lang.Object listener)protected voidremovePackageFromPreferred(java.lang.String packageName)protected voidremovePermission(java.lang.String name)protected voidreplacePreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)protected android.content.pm.ResolveInforesolveActivity(android.content.Intent intent, int flags)protected android.content.pm.ResolveInforesolveActivityAsUser(android.content.Intent intent, int flags, int userId)Behaves asresolveActivity(Intent, int)and currently ignores userId.protected android.content.pm.ProviderInforesolveContentProvider(java.lang.String name, int flags)protected android.content.pm.ProviderInforesolveContentProviderAsUser(java.lang.String name, int flags, int userId)protected android.content.pm.ResolveInforesolveService(android.content.Intent intent, int flags)protected voidrevokeRuntimePermission(java.lang.String packageName, java.lang.String permissionName, android.os.UserHandle user)protected voidsetApplicationEnabledSetting(java.lang.String packageName, int newState, int flags)protected booleansetApplicationHiddenSettingAsUser(java.lang.String packageName, boolean hidden, android.os.UserHandle user)protected voidsetComponentEnabledSetting(android.content.ComponentName componentName, int newState, int flags)protected booleansetDefaultBrowserPackageNameAsUser(java.lang.String packageName, int userId)protected java.lang.String[]setDistractingPackageRestrictions(java.lang.String[] packages, int restrictionFlags)protected voidsetInstallerPackageName(java.lang.String targetPackage, java.lang.String installerPackageName)protected java.lang.ObjectsetPackagesSuspended(java.lang.Object packageNames, java.lang.Object suspended, java.lang.Object appExtras, java.lang.Object launcherExtras, java.lang.Object dialogInfo)protected java.lang.String[]setPackagesSuspended(java.lang.String[] packageNames, boolean suspended, android.os.PersistableBundle appExtras, android.os.PersistableBundle launcherExtras, java.lang.String dialogMessage)protected java.lang.String[]setPackagesSuspendedAsUser(java.lang.String[] packageNames, boolean suspended, int userId)protected booleanshouldShowRequestPermissionRationale(java.lang.String permission)protected voidunregisterMoveCallback(java.lang.Object callback)protected booleanupdateIntentVerificationStatusAsUser(java.lang.String packageName, int status, int userId)protected voidupdatePermissionFlags(java.lang.String permissionName, java.lang.String packageName, int flagMask, int flagValues, android.os.UserHandle user)protected voidverifyIntentFilter(int id, int verificationCode, java.util.List<java.lang.String> failedDomains)protected voidverifyPendingInstall(int id, int verificationCode)-
Methods inherited from class org.robolectric.shadows.ShadowPackageManager
addActivityIcon, addActivityIcon, addActivityIfNotPresent, addCanonicalName, addChangedPackage, addCurrentToCannonicalName, addDrawableResolution, addIntentFilterForActivity, addIntentFilterForProvider, addIntentFilterForReceiver, addIntentFilterForService, addOrUpdateActivity, addOrUpdateProvider, addOrUpdateReceiver, addOrUpdateService, addPackage, addPackage, addPackage, addPackageInternal, addPackageNoDefaults, addPermissionGroupInfo, addPermissionInfo, addPreferredActivityInternal, addProviderIfNotPresent, addReceiverIfNotPresent, addResolveInfoForIntent, addResolveInfoForIntent, addResolveInfoForIntentNoDefaults, addServiceIfNotPresent, addSystemAvailableFeature, addSystemSharedLibraryName, clearIntentFilterForActivity, clearIntentFilterForProvider, clearIntentFilterForReceiver, clearIntentFilterForService, clearPackagePreferredActivitiesInternal, clearSystemAvailableFeatures, clearSystemSharedLibraryNames, deleteModule, deletePackage, doPendingUninstallCallbacks, freeStorage, getComponentEnabledSettingFlags, getDeletedPackages, getDistractingPackageRestrictions, getIntentFiltersForActivity, getIntentFiltersForProvider, getIntentFiltersForReceiver, getIntentFiltersForService, getInternalMutablePackageInfo, getPackageArchiveInfo, getPackageInfoForTesting, getPackageSetting, getPersistentPreferredActivities, getPreferredActivitiesInternal, getVerificationExtendedTimeout, getVerificationResult, installModule, installPackage, mapForPackage, queryBroadcastReceivers, queryBroadcastReceiversAsUser, queryOverriddenIntents, removeActivity, removePackage, removeProvider, removeReceiver, removeResolveInfosForIntent, removeService, reset, setApplicationIcon, setCanRequestPackageInstalls, setNameForUid, setPackageArchiveInfo, setPackagesForCallingUid, setPackagesForUid, setResolveInfosForIntent, setSafeMode, setShouldShowActivityChooser, setShouldShowRequestPermissionRationale, setSystemFeature, setUnbadgedApplicationIcon
-
-
-
-
Method Detail
-
getInstalledPackages
@Implementation public java.util.List<android.content.pm.PackageInfo> getInstalledPackages(int flags)
-
getInstalledModules
@Implementation(minSdk=29) protected java.util.List<android.content.pm.ModuleInfo> getInstalledModules(int flags)
-
getModuleInfo
@Implementation(minSdk=29) protected java.lang.Object getModuleInfo(java.lang.String packageName, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getActivityInfo
@Implementation protected android.content.pm.ActivityInfo getActivityInfo(android.content.ComponentName component, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
hasSystemFeature
@Implementation protected boolean hasSystemFeature(java.lang.String name)
-
getComponentEnabledSetting
@Implementation protected int getComponentEnabledSetting(android.content.ComponentName componentName)
-
getNameForUid
@Implementation protected java.lang.String getNameForUid(int uid)
-
getPackagesForUid
@Implementation protected java.lang.String[] getPackagesForUid(int uid)
- Overrides:
getPackagesForUidin classShadowPackageManager
-
getApplicationEnabledSetting
@Implementation protected int getApplicationEnabledSetting(java.lang.String packageName)
-
getProviderInfo
@Implementation protected android.content.pm.ProviderInfo getProviderInfo(android.content.ComponentName component, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
setComponentEnabledSetting
@Implementation protected void setComponentEnabledSetting(android.content.ComponentName componentName, int newState, int flags)
-
setApplicationEnabledSetting
@Implementation protected void setApplicationEnabledSetting(java.lang.String packageName, int newState, int flags)
-
resolveActivity
@Implementation protected android.content.pm.ResolveInfo resolveActivity(android.content.Intent intent, int flags)
-
resolveContentProvider
@Implementation protected android.content.pm.ProviderInfo resolveContentProvider(java.lang.String name, int flags)
-
resolveContentProviderAsUser
@Implementation(minSdk=21) protected android.content.pm.ProviderInfo resolveContentProviderAsUser(java.lang.String name, int flags, int userId)
-
getPackageInfo
@Implementation protected android.content.pm.PackageInfo getPackageInfo(java.lang.String packageName, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
queryIntentServices
@Implementation protected java.util.List<android.content.pm.ResolveInfo> queryIntentServices(android.content.Intent intent, int flags)
-
queryIntentServicesAsUser
@Implementation(minSdk=17) protected java.util.List<android.content.pm.ResolveInfo> queryIntentServicesAsUser(android.content.Intent intent, int flags, int userId)Behaves asqueryIntentServices(Intent, int)and currently ignores userId.
-
queryIntentActivities
@Implementation protected java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(android.content.Intent intent, int flags)
-
queryIntentActivitiesAsUser
@Implementation(minSdk=17) protected java.util.List<android.content.pm.ResolveInfo> queryIntentActivitiesAsUser(android.content.Intent intent, int flags, int userId)Behaves asqueryIntentActivities(Intent, int)and currently ignores userId.
-
checkPermission
@Implementation protected int checkPermission(java.lang.String permName, java.lang.String pkgName)
-
getReceiverInfo
@Implementation protected android.content.pm.ActivityInfo getReceiverInfo(android.content.ComponentName component, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
queryBroadcastReceivers
@Implementation protected java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceivers(android.content.Intent intent, int flags)
-
resolveService
@Implementation protected android.content.pm.ResolveInfo resolveService(android.content.Intent intent, int flags)
-
getServiceInfo
@Implementation protected android.content.pm.ServiceInfo getServiceInfo(android.content.ComponentName component, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getResourcesForApplication
@Implementation protected android.content.res.Resources getResourcesForApplication(android.content.pm.ApplicationInfo applicationInfo) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getInstalledApplications
@Implementation protected java.util.List<android.content.pm.ApplicationInfo> getInstalledApplications(int flags)
-
getInstallerPackageName
@Implementation protected java.lang.String getInstallerPackageName(java.lang.String packageName)
-
getPermissionInfo
@Implementation protected android.content.pm.PermissionInfo getPermissionInfo(java.lang.String name, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
shouldShowRequestPermissionRationale
@Implementation(minSdk=23) protected boolean shouldShowRequestPermissionRationale(java.lang.String permission)
-
getSystemAvailableFeatures
@Implementation protected android.content.pm.FeatureInfo[] getSystemAvailableFeatures()
-
verifyPendingInstall
@Implementation protected void verifyPendingInstall(int id, int verificationCode)
-
extendVerificationTimeout
@Implementation(minSdk=17) protected void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)
-
freeStorageAndNotify
@Implementation(maxSdk=22) protected void freeStorageAndNotify(long freeStorageSize, android.content.pm.IPackageDataObserver observer)- Overrides:
freeStorageAndNotifyin classShadowPackageManager
-
freeStorageAndNotify
@Implementation(minSdk=23) protected void freeStorageAndNotify(java.lang.String volumeUuid, long freeStorageSize, android.content.pm.IPackageDataObserver observer)
-
setInstallerPackageName
@Implementation protected void setInstallerPackageName(java.lang.String targetPackage, java.lang.String installerPackageName)
-
queryIntentContentProviders
@Implementation(minSdk=19) protected java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.Intent intent, int flags)
-
queryIntentContentProvidersAsUser
@Implementation(minSdk=19) protected java.util.List<android.content.pm.ResolveInfo> queryIntentContentProvidersAsUser(android.content.Intent intent, int flags, int userId)
-
getPermissionControllerPackageName
@Implementation(minSdk=23) protected java.lang.String getPermissionControllerPackageName()
-
getPackageSizeInfo
@Implementation(maxSdk=16) protected void getPackageSizeInfo(java.lang.Object pkgName, java.lang.Object observer)
-
getPackageSizeInfo
@Implementation(minSdk=17, maxSdk=23) protected void getPackageSizeInfo(java.lang.Object pkgName, java.lang.Object uid, java.lang.Object observer)
-
getPackageSizeInfoAsUser
@Implementation(minSdk=24) protected void getPackageSizeInfoAsUser(java.lang.Object pkgName, java.lang.Object uid, java.lang.Object observer)
-
deletePackage
@Implementation protected void deletePackage(java.lang.String packageName, android.content.pm.IPackageDeleteObserver observer, int flags)- Overrides:
deletePackagein classShadowPackageManager
-
currentToCanonicalPackageNames
@Implementation protected java.lang.String[] currentToCanonicalPackageNames(java.lang.String[] names)
-
canonicalToCurrentPackageNames
@Implementation protected java.lang.String[] canonicalToCurrentPackageNames(java.lang.String[] names)
-
isSafeMode
@Implementation protected boolean isSafeMode()
-
getApplicationIcon
@Implementation protected android.graphics.drawable.Drawable getApplicationIcon(java.lang.String packageName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getApplicationIcon
@Implementation protected android.graphics.drawable.Drawable getApplicationIcon(android.content.pm.ApplicationInfo info) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getUserBadgeForDensity
@Implementation(minSdk=21) protected android.graphics.drawable.Drawable getUserBadgeForDensity(android.os.UserHandle userHandle, int i)
-
checkSignatures
@Implementation protected int checkSignatures(java.lang.String pkg1, java.lang.String pkg2)
-
checkSignatures
@Implementation protected int checkSignatures(int uid1, int uid2)
-
queryPermissionsByGroup
@Implementation protected java.util.List<android.content.pm.PermissionInfo> queryPermissionsByGroup(java.lang.String group, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getLaunchIntentForPackage
@Implementation protected android.content.Intent getLaunchIntentForPackage(java.lang.String packageName)
-
getLeanbackLaunchIntentForPackage
@Implementation(minSdk=21) protected android.content.Intent getLeanbackLaunchIntentForPackage(java.lang.String packageName)
-
getPackageInfoAsUser
@Implementation(minSdk=24) protected android.content.pm.PackageInfo getPackageInfoAsUser(java.lang.String packageName, int flags, int userId) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getPackageGids
@Implementation protected int[] getPackageGids(java.lang.String packageName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getPackageGids
@Implementation(minSdk=24) protected int[] getPackageGids(java.lang.String packageName, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getPackageUid
@Implementation(minSdk=18) protected int getPackageUid(java.lang.String packageName, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getPackageUidAsUser
@Implementation(minSdk=24) protected int getPackageUidAsUser(java.lang.String packageName, int userId) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getPackageUidAsUser
@Implementation(minSdk=24) protected int getPackageUidAsUser(java.lang.String packageName, int flags, int userId) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getPermissionGroupInfo
@Implementation protected android.content.pm.PermissionGroupInfo getPermissionGroupInfo(java.lang.String name, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException- See Also:
ShadowPackageManager.addPermissionGroupInfo(android.content.pm.PermissionGroupInfo)
-
getAllPermissionGroups
@Implementation protected java.util.List<android.content.pm.PermissionGroupInfo> getAllPermissionGroups(int flags)
-
getApplicationInfo
@Implementation protected android.content.pm.ApplicationInfo getApplicationInfo(java.lang.String packageName, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getSystemSharedLibraryNames
@Implementation protected java.lang.String[] getSystemSharedLibraryNames()
Returns all the values added viaShadowPackageManager.addSystemSharedLibraryName(String).
-
getServicesSystemSharedLibraryPackageName
@Implementation(minSdk=24) protected java.lang.String getServicesSystemSharedLibraryPackageName()
-
getSharedSystemSharedLibraryPackageName
@Implementation(minSdk=24) protected java.lang.String getSharedSystemSharedLibraryPackageName()
-
hasSystemFeature
@Implementation(minSdk=24) protected boolean hasSystemFeature(java.lang.String name, int version)
-
isPermissionRevokedByPolicy
@Implementation(minSdk=23) protected boolean isPermissionRevokedByPolicy(java.lang.String permName, java.lang.String pkgName)
-
addPermission
@Implementation protected boolean addPermission(android.content.pm.PermissionInfo info)
-
addPermissionAsync
@Implementation protected boolean addPermissionAsync(android.content.pm.PermissionInfo info)
-
removePermission
@Implementation protected void removePermission(java.lang.String name)
-
grantRuntimePermission
@Implementation(minSdk=23) protected void grantRuntimePermission(java.lang.String packageName, java.lang.String permissionName, android.os.UserHandle user)
-
revokeRuntimePermission
@Implementation(minSdk=23) protected void revokeRuntimePermission(java.lang.String packageName, java.lang.String permissionName, android.os.UserHandle user)
-
getPermissionFlags
@Implementation(minSdk=23) protected int getPermissionFlags(java.lang.String permissionName, java.lang.String packageName, android.os.UserHandle user)
-
updatePermissionFlags
@Implementation(minSdk=23) protected void updatePermissionFlags(java.lang.String permissionName, java.lang.String packageName, int flagMask, int flagValues, android.os.UserHandle user)
-
getUidForSharedUser
@Implementation protected int getUidForSharedUser(java.lang.String sharedUserName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getInstalledPackagesAsUser
@Implementation(minSdk=24) protected java.util.List<android.content.pm.PackageInfo> getInstalledPackagesAsUser(int flags, int userId)
-
getPackagesHoldingPermissions
@Implementation(minSdk=18) protected java.util.List<android.content.pm.PackageInfo> getPackagesHoldingPermissions(java.lang.String[] permissions, int flags)
-
resolveActivityAsUser
@Implementation(minSdk=17) protected android.content.pm.ResolveInfo resolveActivityAsUser(android.content.Intent intent, int flags, int userId)Behaves asresolveActivity(Intent, int)and currently ignores userId.
-
queryIntentActivityOptions
@Implementation protected java.util.List<android.content.pm.ResolveInfo> queryIntentActivityOptions(android.content.ComponentName caller, android.content.Intent[] specifics, android.content.Intent intent, int flags)
-
queryBroadcastReceiversAsUser
@Implementation(minSdk=24) protected java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceiversAsUser(android.content.Intent intent, int flags, int userId)
-
queryContentProviders
@Implementation protected java.util.List<android.content.pm.ProviderInfo> queryContentProviders(java.lang.String processName, int uid, int flags)
-
getInstrumentationInfo
@Implementation protected android.content.pm.InstrumentationInfo getInstrumentationInfo(android.content.ComponentName className, int flags) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
queryInstrumentation
@Implementation protected java.util.List<android.content.pm.InstrumentationInfo> queryInstrumentation(java.lang.String targetPackage, int flags)
-
getDrawable
@Implementation protected android.graphics.drawable.Drawable getDrawable(java.lang.String packageName, @DrawableRes int resId, android.content.pm.ApplicationInfo appInfo)
-
getActivityIcon
@Implementation protected android.graphics.drawable.Drawable getActivityIcon(android.content.ComponentName activityName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getDefaultActivityIcon
@Implementation protected android.graphics.drawable.Drawable getDefaultActivityIcon()
-
getResourcesForActivity
@Implementation protected android.content.res.Resources getResourcesForActivity(android.content.ComponentName activityName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getResourcesForApplication
@Implementation protected android.content.res.Resources getResourcesForApplication(java.lang.String appPackageName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
getResourcesForApplicationAsUser
@Implementation(minSdk=17) protected android.content.res.Resources getResourcesForApplicationAsUser(java.lang.String appPackageName, int userId) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
addOnPermissionsChangeListener
@Implementation(minSdk=23) protected void addOnPermissionsChangeListener(java.lang.Object listener)
-
removeOnPermissionsChangeListener
@Implementation(minSdk=23) protected void removeOnPermissionsChangeListener(java.lang.Object listener)
-
installPackage
@Implementation(maxSdk=27) protected void installPackage(java.lang.Object packageURI, java.lang.Object observer, java.lang.Object flags, java.lang.Object installerPackageName)
-
installExistingPackage
@Implementation(minSdk=17) protected int installExistingPackage(java.lang.String packageName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
installExistingPackageAsUser
@Implementation(minSdk=24) protected int installExistingPackageAsUser(java.lang.String packageName, int userId) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
verifyIntentFilter
@Implementation(minSdk=23) protected void verifyIntentFilter(int id, int verificationCode, java.util.List<java.lang.String> failedDomains)
-
getIntentVerificationStatusAsUser
@Implementation(minSdk=24) protected int getIntentVerificationStatusAsUser(java.lang.String packageName, int userId)
-
updateIntentVerificationStatusAsUser
@Implementation(minSdk=24) protected boolean updateIntentVerificationStatusAsUser(java.lang.String packageName, int status, int userId)
-
getIntentFilterVerifications
@Implementation(minSdk=23) protected java.util.List<android.content.pm.IntentFilterVerificationInfo> getIntentFilterVerifications(java.lang.String packageName)
-
getAllIntentFilters
@Implementation(minSdk=23) protected java.util.List<android.content.IntentFilter> getAllIntentFilters(java.lang.String packageName)
-
getDefaultBrowserPackageNameAsUser
@Implementation(minSdk=24) protected java.lang.String getDefaultBrowserPackageNameAsUser(int userId)
-
setDefaultBrowserPackageNameAsUser
@Implementation(minSdk=24) protected boolean setDefaultBrowserPackageNameAsUser(java.lang.String packageName, int userId)
-
getMoveStatus
@Implementation(minSdk=23) protected int getMoveStatus(int moveId)
-
registerMoveCallback
@Implementation(minSdk=23) protected void registerMoveCallback(java.lang.Object callback, java.lang.Object handler)
-
unregisterMoveCallback
@Implementation(minSdk=23) protected void unregisterMoveCallback(java.lang.Object callback)
-
movePackage
@Implementation(minSdk=23) protected java.lang.Object movePackage(java.lang.Object packageName, java.lang.Object vol)
-
getPackageCurrentVolume
@Implementation(minSdk=23) protected java.lang.Object getPackageCurrentVolume(java.lang.Object app)
-
getPackageCandidateVolumes
@Implementation(minSdk=23) protected java.util.List<android.os.storage.VolumeInfo> getPackageCandidateVolumes(android.content.pm.ApplicationInfo app)
-
movePrimaryStorage
@Implementation(minSdk=23) protected java.lang.Object movePrimaryStorage(java.lang.Object vol)
-
getPrimaryStorageCurrentVolume
@Implementation(minSdk=23) protected java.lang.Object getPrimaryStorageCurrentVolume()
-
getPrimaryStorageCandidateVolumes
@Implementation(minSdk=23) protected java.util.List<android.os.storage.VolumeInfo> getPrimaryStorageCandidateVolumes()
-
deletePackageAsUser
@Implementation(minSdk=24) protected void deletePackageAsUser(java.lang.String packageName, android.content.pm.IPackageDeleteObserver observer, int flags, int userId)
-
clearApplicationUserData
@Implementation protected void clearApplicationUserData(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)
-
deleteApplicationCacheFiles
@Implementation protected void deleteApplicationCacheFiles(java.lang.String packageName, android.content.pm.IPackageDataObserver observer)
-
deleteApplicationCacheFilesAsUser
@Implementation(minSdk=24) protected void deleteApplicationCacheFilesAsUser(java.lang.String packageName, int userId, android.content.pm.IPackageDataObserver observer)
-
freeStorage
@Implementation(minSdk=23) protected void freeStorage(java.lang.String volumeUuid, long freeStorageSize, android.content.IntentSender pi)
-
setPackagesSuspendedAsUser
@Implementation(minSdk=24, maxSdk=27) protected java.lang.String[] setPackagesSuspendedAsUser(java.lang.String[] packageNames, boolean suspended, int userId)
-
isPackageSuspendedForUser
@Implementation(minSdk=24) protected boolean isPackageSuspendedForUser(java.lang.String packageName, int userId)
-
addPackageToPreferred
@Implementation protected void addPackageToPreferred(java.lang.String packageName)
-
removePackageFromPreferred
@Implementation protected void removePackageFromPreferred(java.lang.String packageName)
-
getPreferredPackages
@Implementation protected java.util.List<android.content.pm.PackageInfo> getPreferredPackages(int flags)
-
addPreferredActivity
@Implementation public void addPreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)
-
replacePreferredActivity
@Implementation protected void replacePreferredActivity(android.content.IntentFilter filter, int match, android.content.ComponentName[] set, android.content.ComponentName activity)
-
getPreferredActivities
@Implementation public int getPreferredActivities(java.util.List<android.content.IntentFilter> outFilters, java.util.List<android.content.ComponentName> outActivities, java.lang.String packageName)
-
clearPackagePreferredActivities
@Implementation protected void clearPackagePreferredActivities(java.lang.String packageName)
-
getHomeActivities
@Implementation(minSdk=19) protected android.content.ComponentName getHomeActivities(java.util.List<android.content.pm.ResolveInfo> outActivities)
-
flushPackageRestrictionsAsUser
@Implementation(minSdk=24) protected void flushPackageRestrictionsAsUser(int userId)
-
setApplicationHiddenSettingAsUser
@Implementation(minSdk=21) protected boolean setApplicationHiddenSettingAsUser(java.lang.String packageName, boolean hidden, android.os.UserHandle user)
-
getApplicationHiddenSettingAsUser
@Implementation(minSdk=21) protected boolean getApplicationHiddenSettingAsUser(java.lang.String packageName, android.os.UserHandle user)
-
getKeySetByAlias
@Implementation(minSdk=21) protected java.lang.Object getKeySetByAlias(java.lang.String packageName, java.lang.String alias)
-
getSigningKeySet
@Implementation(minSdk=21) protected java.lang.Object getSigningKeySet(java.lang.String packageName)
-
isSignedBy
@Implementation(minSdk=21) protected boolean isSignedBy(java.lang.String packageName, java.lang.Object ks)
-
isSignedByExactly
@Implementation(minSdk=21) protected boolean isSignedByExactly(java.lang.String packageName, java.lang.Object ks)
-
getVerifierDeviceIdentity
@Implementation protected android.content.pm.VerifierDeviceIdentity getVerifierDeviceIdentity()
-
isUpgrade
@Implementation(minSdk=22) protected boolean isUpgrade()
-
isPackageAvailable
@Implementation(minSdk=21) protected boolean isPackageAvailable(java.lang.String packageName)
-
addCrossProfileIntentFilter
@Implementation(minSdk=21) protected void addCrossProfileIntentFilter(android.content.IntentFilter filter, int sourceUserId, int targetUserId, int flags)
-
clearCrossProfileIntentFilters
@Implementation(minSdk=21) protected void clearCrossProfileIntentFilters(int sourceUserId)
-
loadUnbadgedItemIcon
@Implementation(minSdk=22) protected android.graphics.drawable.Drawable loadUnbadgedItemIcon(android.content.pm.PackageItemInfo itemInfo, android.content.pm.ApplicationInfo appInfo)Gets the unbadged icon based on the values set byShadowPackageManager.setUnbadgedApplicationIcon(java.lang.String, android.graphics.drawable.Drawable)or returns null if nothing has been set.
-
getUserBadgedIcon
@Implementation(minSdk=21) protected android.graphics.drawable.Drawable getUserBadgedIcon(android.graphics.drawable.Drawable icon, android.os.UserHandle user)Adds a profile badge to the icon. This implementation just returns the unbadged icon, as some default implementations add an internal resource to the icon that is unavailable to Robolectric.
-
canRequestPackageInstalls
@Implementation(minSdk=26) protected boolean canRequestPackageInstalls()
-
getChangedPackages
@Implementation(minSdk=26) protected java.lang.Object getChangedPackages(int sequenceNumber)
-
getSystemTextClassifierPackageName
@Implementation(minSdk=28) public java.lang.String getSystemTextClassifierPackageName()
-
setPackagesSuspended
@Implementation(minSdk=28) @HiddenApi protected java.lang.String[] setPackagesSuspended(java.lang.String[] packageNames, boolean suspended, android.os.PersistableBundle appExtras, android.os.PersistableBundle launcherExtras, java.lang.String dialogMessage)
-
setPackagesSuspended
@Implementation(minSdk=29) @HiddenApi protected java.lang.Object setPackagesSuspended(java.lang.Object packageNames, java.lang.Object suspended, java.lang.Object appExtras, java.lang.Object launcherExtras, java.lang.Object dialogInfo)
-
getUnsuspendablePackages
@HiddenApi @Implementation(minSdk=29) protected java.lang.String[] getUnsuspendablePackages(java.lang.String[] packageNames)
-
isPackageSuspended
@HiddenApi @Implementation(minSdk=28) protected boolean isPackageSuspended(java.lang.String packageName) throws android.content.pm.PackageManager.NameNotFoundException- Throws:
android.content.pm.PackageManager.NameNotFoundException
-
isInstantApp
@Implementation(minSdk=26) protected boolean isInstantApp(java.lang.String packageName)
-
setDistractingPackageRestrictions
@HiddenApi @Implementation(minSdk=29) protected java.lang.String[] setDistractingPackageRestrictions(java.lang.String[] packages, int restrictionFlags)
-
-