@Implements(value=android.content.pm.PackageManager.class) public class ShadowPackageManager extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
ShadowPackageManager.ComponentState |
static class |
ShadowPackageManager.IntentComparator |
static class |
ShadowPackageManager.PackageSetting
Settings for a particular package.
|
Constructor and Description |
---|
ShadowPackageManager() |
Modifier and Type | Method and Description |
---|---|
void |
addActivityIcon(ComponentName component,
Drawable drawable) |
void |
addActivityIcon(Intent intent,
Drawable drawable) |
ActivityInfo |
addActivityIfNotPresent(ComponentName componentName)
Makes sure that given activity exists.
|
void |
addChangedPackage(int sequenceNumber,
String packageName)
Adds
packageName to the list of changed packages for the particular sequenceNumber . |
void |
addCurrentToCannonicalName(String currentName,
String canonicalName) |
void |
addDrawableResolution(String packageName,
int resourceId,
Drawable drawable) |
void |
addIntentFilterForActivity(ComponentName componentName,
IntentFilter filter)
Add intent filter for given activity.
|
void |
addIntentFilterForProvider(ComponentName componentName,
IntentFilter filter)
Add intent filter for given provider.
|
void |
addIntentFilterForReceiver(ComponentName componentName,
IntentFilter filter)
Add intent filter for given receiver.
|
void |
addIntentFilterForService(ComponentName componentName,
IntentFilter filter)
Add intent filter for given service.
|
void |
addOrUpdateActivity(ActivityInfo activityInfo)
Adds or updates given activity in the system.
|
void |
addOrUpdateProvider(ProviderInfo providerInfo)
Adds or updates given content provider in the system.
|
void |
addOrUpdateReceiver(ActivityInfo receiverInfo)
Adds or updates given broadcast receiver in the system.
|
void |
addOrUpdateService(ServiceInfo serviceInfo)
Adds or updates given service in the system.
|
void |
addPackage(PackageInfo packageInfo)
Deprecated.
|
void |
addPackage(PackageInfo packageInfo,
PackageStats packageStats)
Installs a package with its stats with the
PackageManager . |
void |
addPackage(String packageName)
Deprecated.
Use
installPackage(PackageInfo) instead. |
void |
addPackageInternal(PackageParser.Package appPackage)
Internal use only.
|
void |
addPackageNoDefaults(PackageInfo packageInfo)
Adds a package to the
PackageManager , but doesn’t set any default values on it. |
void |
addPermissionGroupInfo(PermissionGroupInfo permissionGroupInfo)
Allows overriding or adding permission-group elements.
|
void |
addPermissionInfo(PermissionInfo permissionInfo) |
protected static void |
addPreferredActivityInternal(IntentFilter filter,
ComponentName activity,
SortedMap<ComponentName,List<IntentFilter>> preferredActivitiesMap) |
ProviderInfo |
addProviderIfNotPresent(ComponentName componentName)
Makes sure that given provider exists.
|
ActivityInfo |
addReceiverIfNotPresent(ComponentName componentName)
Makes sure that given receiver exists.
|
void |
addResolveInfoForIntent(Intent intent,
List<ResolveInfo> info)
Deprecated.
see note on
addResolveInfoForIntent(Intent, ResolveInfo) . |
void |
addResolveInfoForIntent(Intent intent,
ResolveInfo info)
Deprecated.
use
addIntentFilterForComponent(android.content.ComponentName, android.content.IntentFilter, java.util.Map<android.content.ComponentName, java.util.List<android.content.IntentFilter>>) instead and if the component doesn’t exist add it using any of installPackage(android.content.pm.PackageInfo) , addOrUpdateActivity(android.content.pm.ActivityInfo) , addActivityIfNotPresent(android.content.ComponentName) or their counterparts for other types of components. |
void |
addResolveInfoForIntentNoDefaults(Intent intent,
ResolveInfo info)
Deprecated.
see the note on
addResolveInfoForIntent(Intent, ResolveInfo) . |
ServiceInfo |
addServiceIfNotPresent(ComponentName componentName)
Makes sure that given service exists.
|
void |
addSystemAvailableFeature(FeatureInfo featureInfo) |
void |
addSystemSharedLibraryName(String name)
Adds a value to be returned by
PackageManager.getSystemSharedLibraryNames() . |
void |
clearIntentFilterForActivity(ComponentName componentName)
Clears intent filters for given activity.
|
void |
clearIntentFilterForProvider(ComponentName componentName)
Clears intent filters for given provider.
|
void |
clearIntentFilterForReceiver(ComponentName componentName)
Clears intent filters for given receiver.
|
void |
clearIntentFilterForService(ComponentName componentName)
Clears intent filters for given service.
|
protected static void |
clearPackagePreferredActivitiesInternal(String packageName,
SortedMap<ComponentName,List<IntentFilter>> preferredActivitiesMap) |
void |
clearSystemAvailableFeatures() |
void |
clearSystemSharedLibraryNames()
Clears the values returned by
PackageManager.getSystemSharedLibraryNames() . |
void |
deletePackage(String packageName)
Uninstalls the package from the system in a way, that will allow its discovery through
PackageManager.MATCH_UNINSTALLED_PACKAGES . |
protected void |
deletePackage(String packageName,
IPackageDeleteObserver observer,
int flags) |
void |
doPendingUninstallCallbacks()
Runs the callbacks pending from calls to
PackageManager.deletePackage(String,
IPackageDeleteObserver, int) |
protected void |
freeStorage(long freeStorageSize,
IntentSender pi) |
protected void |
freeStorageAndNotify(long freeStorageSize,
IPackageDataObserver observer) |
int |
getComponentEnabledSettingFlags(ComponentName componentName)
Return the flags set in call to
ApplicationPackageManager.setComponentEnabledSetting(ComponentName, int, int) . |
Set<String> |
getDeletedPackages()
Returns package names successfully deleted with
PackageManager.deletePackage(String,
IPackageDeleteObserver, int) Note that like real PackageManager the calling context must have Manifest.permission.DELETE_PACKAGES permission set. |
List<IntentFilter> |
getIntentFiltersForActivity(ComponentName componentName)
Get list of intent filters defined for given activity.
|
List<IntentFilter> |
getIntentFiltersForProvider(ComponentName componentName)
Get list of intent filters defined for given provider.
|
List<IntentFilter> |
getIntentFiltersForReceiver(ComponentName componentName)
Get list of intent filters defined for given receiver.
|
List<IntentFilter> |
getIntentFiltersForService(ComponentName componentName)
Get list of intent filters defined for given service.
|
PackageInfo |
getInternalMutablePackageInfo(String packageName)
Testing API allowing to retrieve internal package representation.
|
protected PackageInfo |
getPackageArchiveInfo(String archiveFilePath,
int flags) |
PackageInfo |
getPackageInfoForTesting(String packageName)
Deprecated.
Use
getInternalMutablePackageInfo(java.lang.String) instead. It has better name. |
ShadowPackageManager.PackageSetting |
getPackageSetting(String packageName)
Returns the current
ShadowPackageManager.PackageSetting of packageName . |
protected String[] |
getPackagesForUid(int uid) |
int |
getPersistentPreferredActivities(List<IntentFilter> outFilters,
List<ComponentName> outActivities,
String packageName)
Method to retrieve persistent preferred activities as set by
DevicePolicyManager.addPersistentPreferredActivity(android.content.ComponentName, android.content.IntentFilter, android.content.ComponentName) . |
protected static int |
getPreferredActivitiesInternal(List<IntentFilter> outFilters,
List<ComponentName> outActivities,
String packageName,
SortedMap<ComponentName,List<IntentFilter>> preferredActivitiesMap) |
long |
getVerificationExtendedTimeout(int id) |
int |
getVerificationResult(int id) |
void |
installPackage(PackageInfo packageInfo)
Installs a package with the
PackageManager . |
protected static <V> SortedMap<ComponentName,V> |
mapForPackage(SortedMap<ComponentName,V> input,
String packageName) |
protected List<ResolveInfo> |
queryBroadcastReceivers(Intent intent,
int flags,
int userId) |
protected List<ResolveInfo> |
queryBroadcastReceiversAsUser(Intent intent,
int flags,
UserHandle userHandle) |
protected List<ResolveInfo> |
queryOverriddenIntents(Intent intent,
int flags) |
ActivityInfo |
removeActivity(ComponentName componentName)
Removes activity from the package manager.
|
void |
removePackage(String packageName) |
ProviderInfo |
removeProvider(ComponentName componentName)
Removes content provider from the package manager.
|
ActivityInfo |
removeReceiver(ComponentName componentName)
Removes broadcast receiver from the package manager.
|
void |
removeResolveInfosForIntent(Intent intent,
String packageName)
Deprecated.
see note on
addResolveInfoForIntent(Intent, ResolveInfo) . |
ServiceInfo |
removeService(ComponentName componentName)
Removes service from the package manager.
|
static void |
reset() |
void |
setApplicationIcon(String packageName,
Drawable drawable) |
void |
setCanRequestPackageInstalls(boolean canRequestPackageInstalls)
Sets if the
PackageManager is allowed to request package installs through package installer. |
void |
setNameForUid(int uid,
String name) |
void |
setPackageArchiveInfo(String archiveFilePath,
PackageInfo packageInfo) |
void |
setPackagesForCallingUid(String... packagesForCallingUid) |
void |
setPackagesForUid(int uid,
String... packagesForCallingUid) |
void |
setResolveInfosForIntent(Intent intent,
List<ResolveInfo> info)
Deprecated.
see the note on
addResolveInfoForIntent(Intent, ResolveInfo) . |
void |
setSafeMode(boolean safeMode)
Set value to be returned by
PackageManager.isSafeMode() . |
void |
setShouldShowActivityChooser(boolean shouldShowActivityChooser)
If this method has been called with
true , then in cases where many activities match a filter, an activity chooser will be resolved instead of just the first pick. |
void |
setShouldShowRequestPermissionRationale(String permission,
boolean show) |
void |
setSystemFeature(String name,
boolean supported) |
void |
setUnbadgedApplicationIcon(String packageName,
Drawable drawable) |
public ActivityInfo addActivityIfNotPresent(ComponentName componentName)
Makes sure that given activity exists.
If the activity doesn’t exist yet, it will be created with applicationInfo
set to an existing application, or if it doesn’t exist, a new package will be created.
public ServiceInfo addServiceIfNotPresent(ComponentName componentName)
Makes sure that given service exists.
If the service doesn’t exist yet, it will be created with applicationInfo
set to an existing application, or if it doesn’t exist, a new package will be created.
public ActivityInfo addReceiverIfNotPresent(ComponentName componentName)
Makes sure that given receiver exists.
If the receiver doesn’t exist yet, it will be created with applicationInfo
set to an existing application, or if it doesn’t exist, a new package will be created.
public ProviderInfo addProviderIfNotPresent(ComponentName componentName)
Makes sure that given provider exists.
If the provider doesn’t exist yet, it will be created with applicationInfo
set to an existing application, or if it doesn’t exist, a new package will be created.
public void addOrUpdateActivity(ActivityInfo activityInfo)
Adds or updates given activity in the system.
If activity with the same PackageItemInfo.name
and ComponentInfo#packageName
exists it will be updated. Its ComponentInfo.applicationInfo
is always set to ApplicationInfo
already existing in the system, but if no application exists a new one will be created using ComponentInfo.applicationInfo
in this component.
public void addOrUpdateService(ServiceInfo serviceInfo)
Adds or updates given service in the system.
If service with the same PackageItemInfo.name
and ComponentInfo#packageName
exists it will be updated. Its ComponentInfo.applicationInfo
is always set to ApplicationInfo
already existing in the system, but if no application exists a new one will be created using ComponentInfo.applicationInfo
in this component.
public void addOrUpdateReceiver(ActivityInfo receiverInfo)
Adds or updates given broadcast receiver in the system.
If broadcast receiver with the same PackageItemInfo.name
and ComponentInfo#packageName
exists it will be updated. Its ComponentInfo.applicationInfo
is always set to ApplicationInfo
already existing in the system, but if no application exists a new one will be created using ComponentInfo.applicationInfo
in this component.
public void addOrUpdateProvider(ProviderInfo providerInfo)
Adds or updates given content provider in the system.
If content provider with the same PackageItemInfo.name
and ComponentInfo#packageName
exists it will be updated. Its ComponentInfo.applicationInfo
is always set to ApplicationInfo
already existing in the system, but if no application exists a new one will be created using ComponentInfo.applicationInfo
in this component.
@Nullable public ActivityInfo removeActivity(ComponentName componentName)
Removes activity from the package manager.
null
if no such component existed.@Nullable public ServiceInfo removeService(ComponentName componentName)
Removes service from the package manager.
null
if no such component existed.@Nullable public ProviderInfo removeProvider(ComponentName componentName)
Removes content provider from the package manager.
null
if no such component existed.@Nullable public ActivityInfo removeReceiver(ComponentName componentName)
Removes broadcast receiver from the package manager.
null
if no such component existed.@Deprecated public void setResolveInfosForIntent(Intent intent, List<ResolveInfo> info)
addResolveInfoForIntent(Intent, ResolveInfo)
.Sets extra resolve infos for an intent.
Those entries are added to whatever might be in the manifest already.
Note that all resolve infos will have ResolveInfo.isDefault
field set to true
to allow their resolution for implicit intents. If this is not what you want, then you still have the reference to those ResolveInfos, and you can set the field back to false
.
@Deprecated public void addResolveInfoForIntent(Intent intent, List<ResolveInfo> info)
addResolveInfoForIntent(Intent, ResolveInfo)
.@Deprecated public void addResolveInfoForIntent(Intent intent, ResolveInfo info)
addIntentFilterForComponent(android.content.ComponentName, android.content.IntentFilter, java.util.Map<android.content.ComponentName, java.util.List<android.content.IntentFilter>>)
instead and if the component doesn’t exist add it using any of installPackage(android.content.pm.PackageInfo)
, addOrUpdateActivity(android.content.pm.ActivityInfo)
, addActivityIfNotPresent(android.content.ComponentName)
or their counterparts for other types of components.Adds extra resolve info for an intent.
Note that this resolve info will have ResolveInfo.isDefault
field set to true
to allow its resolution for implicit intents. If this is not what you want, then please use addResolveInfoForIntentNoDefaults(android.content.Intent, android.content.pm.ResolveInfo)
instead.
@Deprecated public void addResolveInfoForIntentNoDefaults(Intent intent, ResolveInfo info)
addResolveInfoForIntent(Intent, ResolveInfo)
.Adds the info
as ResolveInfo
for the intent but without applying any default values.
In particular it will not make the ResolveInfo.isDefault
field true
, that means that this resolve info will not resolve for Intent.resolveActivity(android.content.pm.PackageManager)
and Context.startActivity(android.content.Intent)
.
@Deprecated public void removeResolveInfosForIntent(Intent intent, String packageName)
addResolveInfoForIntent(Intent, ResolveInfo)
.Removes ResolveInfo
s registered using addResolveInfoForIntent(android.content.Intent, java.util.List<android.content.pm.ResolveInfo>)
.
public void addActivityIcon(ComponentName component, Drawable drawable)
public void setUnbadgedApplicationIcon(String packageName, Drawable drawable)
public int getComponentEnabledSettingFlags(ComponentName componentName)
Return the flags set in call to ApplicationPackageManager.setComponentEnabledSetting(ComponentName, int, int)
.
componentName
- The component name.public void installPackage(PackageInfo packageInfo)
Installs a package with the PackageManager
.
In order to create PackageInfo objects in a valid state please use androidx.test.core.content.pm.PackageInfoBuilder
.
This method automatically simulates instalation of a package in the system, so it adds a flag ApplicationInfo.FLAG_INSTALLED
to the application info and makes sure it exits. It will update applicationInfo in package components as well.
If you don’t want the package to be installed, use addPackageNoDefaults(android.content.pm.PackageInfo)
instead.
public void addPackageNoDefaults(PackageInfo packageInfo)
Adds a package to the PackageManager
, but doesn’t set any default values on it.
Right now it will not set ApplicationInfo.FLAG_INSTALLED
flag on its application, so if not set explicitly, it will be treated as not installed.
public void addPackage(PackageInfo packageInfo, PackageStats packageStats)
Installs a package with its stats with the PackageManager
.
This method doesn’t add any defaults to the packageInfo
parameters. You should make sure it is valid (see installPackage(PackageInfo)
).
@Deprecated public void addPackage(String packageName)
installPackage(PackageInfo)
instead.@Deprecated public void addPackage(PackageInfo packageInfo)
This method is getting renamed to {link installPackage(android.content.pm.PackageInfo)
.
public PackageInfo getInternalMutablePackageInfo(String packageName)
Testing API allowing to retrieve internal package representation.
This will allow to modify the package in a way visible to Robolectric, as this is Robolectric’s internal full package representation.
Note that maybe a better way is to just modify the test manifest to make those modifications in a standard way.
Retrieving package info using PackageManager.getPackageInfo(java.lang.String, int)
/ PackageManager.getApplicationInfo(java.lang.String, int)
will return defensive copies that will be stripped out of information according to provided flags. Don’t use it to modify Robolectric state.
@Deprecated public PackageInfo getPackageInfoForTesting(String packageName)
getInternalMutablePackageInfo(java.lang.String)
instead. It has better name.public void addPermissionInfo(PermissionInfo permissionInfo)
public void addChangedPackage(int sequenceNumber, String packageName)
Adds packageName
to the list of changed packages for the particular sequenceNumber
.
sequenceNumber
- has to be >= 0packageName
- name of the package that was changedpublic void addPermissionGroupInfo(PermissionGroupInfo permissionGroupInfo)
Allows overriding or adding permission-group elements. These would be otherwise specified by either (the system)[https://developer.android.com/guide/topics/permissions/requesting.html#perm-groups] or by (the app itself)[https://developer.android.com/guide/topics/manifest/permission-group-element.html], as part of its manifest
PackageParser.PermissionGroup
s added through this method have precedence over those specified with the same name by one of the aforementioned methods.
public void removePackage(String packageName)
public void setSystemFeature(String name, boolean supported)
public void addDrawableResolution(String packageName, int resourceId, Drawable drawable)
public void setNameForUid(int uid, String name)
public void setPackagesForCallingUid(String... packagesForCallingUid)
public void setPackagesForUid(int uid, String... packagesForCallingUid)
@Implementation @Nullable protected String[] getPackagesForUid(int uid)
public void setPackageArchiveInfo(String archiveFilePath, PackageInfo packageInfo)
public int getVerificationResult(int id)
public long getVerificationExtendedTimeout(int id)
public void setShouldShowRequestPermissionRationale(String permission, boolean show)
public void addSystemAvailableFeature(FeatureInfo featureInfo)
public void clearSystemAvailableFeatures()
public void addSystemSharedLibraryName(String name)
Adds a value to be returned by PackageManager.getSystemSharedLibraryNames()
.
public void clearSystemSharedLibraryNames()
Clears the values returned by PackageManager.getSystemSharedLibraryNames()
.
public void addCurrentToCannonicalName(String currentName, String canonicalName)
public void setCanRequestPackageInstalls(boolean canRequestPackageInstalls)
Sets if the PackageManager
is allowed to request package installs through package installer.
@Implementation(minSdk=24) protected List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, int flags, UserHandle userHandle)
@Implementation(minSdk=17) protected List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags, int userId)
@Implementation protected PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags)
@Implementation protected void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer)
@Implementation protected void freeStorage(long freeStorageSize, IntentSender pi)
public void deletePackage(String packageName)
Uninstalls the package from the system in a way, that will allow its discovery through PackageManager.MATCH_UNINSTALLED_PACKAGES
.
protected void deletePackage(String packageName, IPackageDeleteObserver observer, int flags)
public void doPendingUninstallCallbacks()
Runs the callbacks pending from calls to PackageManager.deletePackage(String,
IPackageDeleteObserver, int)
public Set<String> getDeletedPackages()
Returns package names successfully deleted with PackageManager.deletePackage(String,
IPackageDeleteObserver, int)
Note that like real PackageManager
the calling context must have Manifest.permission.DELETE_PACKAGES
permission set.
protected List<ResolveInfo> queryOverriddenIntents(Intent intent, int flags)
public void addPackageInternal(PackageParser.Package appPackage)
Internal use only.
appPackage
- public List<IntentFilter> getIntentFiltersForActivity(ComponentName componentName) throws PackageManager.NameNotFoundException
Get list of intent filters defined for given activity.
componentName
- Name of the activity whose intent filters are to be retrievedPackageManager.NameNotFoundException
- if component with given name doesn’t exist.public List<IntentFilter> getIntentFiltersForService(ComponentName componentName) throws PackageManager.NameNotFoundException
Get list of intent filters defined for given service.
componentName
- Name of the service whose intent filters are to be retrievedPackageManager.NameNotFoundException
- if component with given name doesn’t exist.public List<IntentFilter> getIntentFiltersForReceiver(ComponentName componentName) throws PackageManager.NameNotFoundException
Get list of intent filters defined for given receiver.
componentName
- Name of the receiver whose intent filters are to be retrievedPackageManager.NameNotFoundException
- if component with given name doesn’t exist.public List<IntentFilter> getIntentFiltersForProvider(ComponentName componentName) throws PackageManager.NameNotFoundException
Get list of intent filters defined for given provider.
componentName
- Name of the provider whose intent filters are to be retrievedPackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void addIntentFilterForActivity(ComponentName componentName, IntentFilter filter) throws PackageManager.NameNotFoundException
Add intent filter for given activity.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void addIntentFilterForService(ComponentName componentName, IntentFilter filter) throws PackageManager.NameNotFoundException
Add intent filter for given service.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void addIntentFilterForReceiver(ComponentName componentName, IntentFilter filter) throws PackageManager.NameNotFoundException
Add intent filter for given receiver.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void addIntentFilterForProvider(ComponentName componentName, IntentFilter filter) throws PackageManager.NameNotFoundException
Add intent filter for given provider.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void clearIntentFilterForActivity(ComponentName componentName) throws PackageManager.NameNotFoundException
Clears intent filters for given activity.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void clearIntentFilterForService(ComponentName componentName) throws PackageManager.NameNotFoundException
Clears intent filters for given service.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void clearIntentFilterForReceiver(ComponentName componentName) throws PackageManager.NameNotFoundException
Clears intent filters for given receiver.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public void clearIntentFilterForProvider(ComponentName componentName) throws PackageManager.NameNotFoundException
Clears intent filters for given provider.
PackageManager.NameNotFoundException
- if component with given name doesn’t exist.public int getPersistentPreferredActivities(List<IntentFilter> outFilters, List<ComponentName> outActivities, String packageName)
Method to retrieve persistent preferred activities as set by DevicePolicyManager.addPersistentPreferredActivity(android.content.ComponentName, android.content.IntentFilter, android.content.ComponentName)
.
Works the same way as analogous PackageManager.getPreferredActivities(java.util.List<android.content.IntentFilter>, java.util.List<android.content.ComponentName>, java.lang.String)
for regular preferred activities.
protected static int getPreferredActivitiesInternal(List<IntentFilter> outFilters, List<ComponentName> outActivities, String packageName, SortedMap<ComponentName,List<IntentFilter>> preferredActivitiesMap)
protected static void clearPackagePreferredActivitiesInternal(String packageName, SortedMap<ComponentName,List<IntentFilter>> preferredActivitiesMap)
protected static void addPreferredActivityInternal(IntentFilter filter, ComponentName activity, SortedMap<ComponentName,List<IntentFilter>> preferredActivitiesMap)
protected static <V> SortedMap<ComponentName,V> mapForPackage(SortedMap<ComponentName,V> input, @Nullable String packageName)
public ShadowPackageManager.PackageSetting getPackageSetting(String packageName)
Returns the current ShadowPackageManager.PackageSetting
of packageName
.
If packageName
is not present in this ShadowPackageManager
, this method will return null.
public void setShouldShowActivityChooser(boolean shouldShowActivityChooser)
If this method has been called with true
, then in cases where many activities match a filter, an activity chooser will be resolved instead of just the first pick.
public void setSafeMode(boolean safeMode)
Set value to be returned by PackageManager.isSafeMode()
.
@Resetter public static void reset()