@Deprecated public class MockPackageManager extends PackageManager
PackageManager
class. All methods are non-functional and throw
UnsupportedOperationException
. Override it to provide the operations that you
need.PackageManager.ApplicationInfoFlags, PackageManager.ComponentInfoFlags, PackageManager.DeleteFlags, PackageManager.InstallFlags, PackageManager.InstrumentationInfoFlags, PackageManager.LegacyPackageDeleteObserver, PackageManager.LegacyPackageInstallObserver, PackageManager.MoveCallback, PackageManager.NameNotFoundException, PackageManager.OnPermissionsChangedListener, PackageManager.PackageInfoFlags, PackageManager.PermissionFlags, PackageManager.PermissionGroupInfoFlags, PackageManager.PermissionInfoFlags, PackageManager.PermissionResult, PackageManager.ResolveInfoFlags
ACTION_CLEAN_EXTERNAL_STORAGE, ACTION_REQUEST_PERMISSIONS, APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE, COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DISABLED, COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED, COMPONENT_ENABLED_STATE_DISABLED_USER, COMPONENT_ENABLED_STATE_ENABLED, DELETE_ALL_USERS, DELETE_DONT_KILL_APP, DELETE_FAILED_ABORTED, DELETE_FAILED_DEVICE_POLICY_MANAGER, DELETE_FAILED_INTERNAL_ERROR, DELETE_FAILED_OWNER_BLOCKED, DELETE_FAILED_USER_RESTRICTED, DELETE_KEEP_DATA, DELETE_SUCCEEDED, DELETE_SYSTEM_APP, DONT_KILL_APP, EXTRA_FAILURE_EXISTING_PACKAGE, EXTRA_FAILURE_EXISTING_PERMISSION, EXTRA_INTENT_FILTER_VERIFICATION_HOSTS, EXTRA_INTENT_FILTER_VERIFICATION_ID, EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME, EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME, EXTRA_MOVE_ID, EXTRA_REQUEST_PERMISSIONS_NAMES, EXTRA_REQUEST_PERMISSIONS_RESULTS, EXTRA_VERIFICATION_ID, EXTRA_VERIFICATION_INSTALL_FLAGS, EXTRA_VERIFICATION_INSTALLER_PACKAGE, EXTRA_VERIFICATION_INSTALLER_UID, EXTRA_VERIFICATION_PACKAGE_NAME, EXTRA_VERIFICATION_RESULT, EXTRA_VERIFICATION_URI, EXTRA_VERIFICATION_VERSION_CODE, FEATURE_APP_WIDGETS, FEATURE_AUDIO_LOW_LATENCY, FEATURE_AUDIO_OUTPUT, FEATURE_AUDIO_PRO, FEATURE_AUTOMOTIVE, FEATURE_BACKUP, FEATURE_BLUETOOTH, FEATURE_BLUETOOTH_LE, FEATURE_CAMERA, FEATURE_CAMERA_ANY, FEATURE_CAMERA_AUTOFOCUS, FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING, FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR, FEATURE_CAMERA_CAPABILITY_RAW, FEATURE_CAMERA_EXTERNAL, FEATURE_CAMERA_FLASH, FEATURE_CAMERA_FRONT, FEATURE_CAMERA_LEVEL_FULL, FEATURE_CONNECTION_SERVICE, FEATURE_CONSUMER_IR, FEATURE_DEVICE_ADMIN, FEATURE_ETHERNET, FEATURE_FAKETOUCH, FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT, FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND, FEATURE_FILE_BASED_ENCRYPTION, FEATURE_FINGERPRINT, FEATURE_FREEFORM_WINDOW_MANAGEMENT, FEATURE_GAMEPAD, FEATURE_HDMI_CEC, FEATURE_HIFI_SENSORS, FEATURE_HOME_SCREEN, FEATURE_INPUT_METHODS, FEATURE_LEANBACK, FEATURE_LEANBACK_ONLY, FEATURE_LIVE_TV, FEATURE_LIVE_WALLPAPER, FEATURE_LOCATION, FEATURE_LOCATION_GPS, FEATURE_LOCATION_NETWORK, FEATURE_MANAGED_PROFILES, FEATURE_MANAGED_USERS, FEATURE_MICROPHONE, FEATURE_MIDI, FEATURE_NFC, FEATURE_NFC_HCE, FEATURE_NFC_HOST_CARD_EMULATION, FEATURE_NFC_HOST_CARD_EMULATION_NFCF, FEATURE_OPENGLES_EXTENSION_PACK, FEATURE_PICTURE_IN_PICTURE, FEATURE_PRINTING, FEATURE_SCREEN_LANDSCAPE, FEATURE_SCREEN_PORTRAIT, FEATURE_SECURELY_REMOVES_USERS, FEATURE_SENSOR_ACCELEROMETER, FEATURE_SENSOR_AMBIENT_TEMPERATURE, FEATURE_SENSOR_BAROMETER, FEATURE_SENSOR_COMPASS, FEATURE_SENSOR_GYROSCOPE, FEATURE_SENSOR_HEART_RATE, FEATURE_SENSOR_HEART_RATE_ECG, FEATURE_SENSOR_LIGHT, FEATURE_SENSOR_PROXIMITY, FEATURE_SENSOR_RELATIVE_HUMIDITY, FEATURE_SENSOR_STEP_COUNTER, FEATURE_SENSOR_STEP_DETECTOR, FEATURE_SIP, FEATURE_SIP_VOIP, FEATURE_TELEPHONY, FEATURE_TELEPHONY_CDMA, FEATURE_TELEPHONY_GSM, FEATURE_TELEVISION, FEATURE_TOUCHSCREEN, FEATURE_TOUCHSCREEN_MULTITOUCH, FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT, FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND, FEATURE_USB_ACCESSORY, FEATURE_USB_HOST, FEATURE_VERIFIED_BOOT, FEATURE_VOICE_RECOGNIZERS, FEATURE_VR_MODE, FEATURE_VR_MODE_HIGH_PERFORMANCE, FEATURE_VULKAN_HARDWARE_LEVEL, FEATURE_VULKAN_HARDWARE_VERSION, FEATURE_WATCH, FEATURE_WEBVIEW, FEATURE_WIFI, FEATURE_WIFI_DIRECT, FEATURE_WIFI_NAN, FLAG_PERMISSION_GRANTED_BY_DEFAULT, FLAG_PERMISSION_POLICY_FIXED, FLAG_PERMISSION_REVIEW_REQUIRED, FLAG_PERMISSION_REVOKE_ON_UPGRADE, FLAG_PERMISSION_SYSTEM_FIXED, FLAG_PERMISSION_USER_FIXED, FLAG_PERMISSION_USER_SET, GET_ACTIVITIES, GET_CONFIGURATIONS, GET_DISABLED_COMPONENTS, GET_DISABLED_UNTIL_USED_COMPONENTS, GET_GIDS, GET_INSTRUMENTATION, GET_INTENT_FILTERS, GET_META_DATA, GET_PERMISSIONS, GET_PROVIDERS, GET_RECEIVERS, GET_RESOLVED_FILTER, GET_SERVICES, GET_SHARED_LIBRARY_FILES, GET_SIGNATURES, GET_UNINSTALLED_PACKAGES, GET_URI_PERMISSION_PATTERNS, INSTALL_ALL_USERS, INSTALL_ALLOW_DOWNGRADE, INSTALL_ALLOW_TEST, INSTALL_DONT_KILL_APP, INSTALL_EPHEMERAL, INSTALL_EXTERNAL, INSTALL_FAILED_ABORTED, INSTALL_FAILED_ALREADY_EXISTS, INSTALL_FAILED_CONFLICTING_PROVIDER, INSTALL_FAILED_CONTAINER_ERROR, INSTALL_FAILED_CPU_ABI_INCOMPATIBLE, INSTALL_FAILED_DEXOPT, INSTALL_FAILED_DUPLICATE_PACKAGE, INSTALL_FAILED_DUPLICATE_PERMISSION, INSTALL_FAILED_EPHEMERAL_INVALID, INSTALL_FAILED_INSUFFICIENT_STORAGE, INSTALL_FAILED_INTERNAL_ERROR, INSTALL_FAILED_INVALID_APK, INSTALL_FAILED_INVALID_INSTALL_LOCATION, INSTALL_FAILED_INVALID_URI, INSTALL_FAILED_MEDIA_UNAVAILABLE, INSTALL_FAILED_MISSING_FEATURE, INSTALL_FAILED_MISSING_SHARED_LIBRARY, INSTALL_FAILED_NEWER_SDK, INSTALL_FAILED_NO_MATCHING_ABIS, INSTALL_FAILED_NO_SHARED_USER, INSTALL_FAILED_OLDER_SDK, INSTALL_FAILED_PACKAGE_CHANGED, INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE, INSTALL_FAILED_REPLACE_COULDNT_DELETE, INSTALL_FAILED_SHARED_USER_INCOMPATIBLE, INSTALL_FAILED_TEST_ONLY, INSTALL_FAILED_UID_CHANGED, INSTALL_FAILED_UPDATE_INCOMPATIBLE, INSTALL_FAILED_USER_RESTRICTED, INSTALL_FAILED_VERIFICATION_FAILURE, INSTALL_FAILED_VERIFICATION_TIMEOUT, INSTALL_FAILED_VERSION_DOWNGRADE, INSTALL_FORCE_PERMISSION_PROMPT, INSTALL_FORCE_SDK, INSTALL_FORCE_VOLUME_UUID, INSTALL_FORWARD_LOCK, INSTALL_FROM_ADB, INSTALL_GRANT_RUNTIME_PERMISSIONS, INSTALL_INTERNAL, INSTALL_PARSE_FAILED_BAD_MANIFEST, INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME, INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID, INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING, INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES, INSTALL_PARSE_FAILED_MANIFEST_EMPTY, INSTALL_PARSE_FAILED_MANIFEST_MALFORMED, INSTALL_PARSE_FAILED_NO_CERTIFICATES, INSTALL_PARSE_FAILED_NOT_APK, INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION, INSTALL_REPLACE_EXISTING, INSTALL_SUCCEEDED, INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS, INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK, INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK, INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER, INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED, INTENT_FILTER_VERIFICATION_FAILURE, INTENT_FILTER_VERIFICATION_SUCCESS, MASK_PERMISSION_FLAGS, MATCH_ALL, MATCH_DEBUG_TRIAGED_MISSING, MATCH_DEFAULT_ONLY, MATCH_DIRECT_BOOT_AWARE, MATCH_DIRECT_BOOT_UNAWARE, MATCH_DISABLED_COMPONENTS, MATCH_DISABLED_UNTIL_USED_COMPONENTS, MATCH_ENCRYPTION_AWARE, MATCH_ENCRYPTION_AWARE_AND_UNAWARE, MATCH_ENCRYPTION_UNAWARE, MATCH_FACTORY_ONLY, MATCH_SYSTEM_ONLY, MATCH_UNINSTALLED_PACKAGES, MAXIMUM_VERIFICATION_TIMEOUT, MOVE_EXTERNAL_MEDIA, MOVE_FAILED_DEVICE_ADMIN, MOVE_FAILED_DOESNT_EXIST, MOVE_FAILED_FORWARD_LOCKED, MOVE_FAILED_INSUFFICIENT_STORAGE, MOVE_FAILED_INTERNAL_ERROR, MOVE_FAILED_INVALID_LOCATION, MOVE_FAILED_OPERATION_PENDING, MOVE_FAILED_SYSTEM_PACKAGE, MOVE_INTERNAL, MOVE_SUCCEEDED, NO_NATIVE_LIBRARIES, NOTIFY_PACKAGE_USE_ACTIVITY, NOTIFY_PACKAGE_USE_BACKUP, NOTIFY_PACKAGE_USE_BROADCAST_RECEIVER, NOTIFY_PACKAGE_USE_CONTENT_PROVIDER, NOTIFY_PACKAGE_USE_CROSS_PACKAGE, NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE, NOTIFY_PACKAGE_USE_INSTRUMENTATION, NOTIFY_PACKAGE_USE_REASONS_COUNT, NOTIFY_PACKAGE_USE_SERVICE, ONLY_IF_NO_MATCH_FOUND, PERMISSION_DENIED, PERMISSION_GRANTED, SIGNATURE_FIRST_NOT_SIGNED, SIGNATURE_MATCH, SIGNATURE_NEITHER_SIGNED, SIGNATURE_NO_MATCH, SIGNATURE_SECOND_NOT_SIGNED, SIGNATURE_UNKNOWN_PACKAGE, SKIP_CURRENT_PROFILE, SYSTEM_SHARED_LIBRARY_SERVICES, SYSTEM_SHARED_LIBRARY_SHARED, VERIFICATION_ALLOW, VERIFICATION_ALLOW_WITHOUT_SUFFICIENT, VERIFICATION_REJECT
Constructor and Description |
---|
MockPackageManager()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addCrossProfileIntentFilter(IntentFilter filter,
int sourceUserId,
int targetUserId,
int flags)
Deprecated.
Adds a
CrossProfileIntentFilter . |
void |
addOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
Deprecated.
Adds a listener for permission changes for installed packages.
|
void |
addPackageToPreferred(String packageName)
Deprecated.
|
boolean |
addPermission(PermissionInfo info)
Deprecated.
Add a new dynamic permission to the system.
|
boolean |
addPermissionAsync(PermissionInfo info)
Deprecated.
Like
PackageManager.addPermission(PermissionInfo) but asynchronously
persists the package manager state after returning from the call,
allowing it to return quicker and batch a series of adds at the
expense of no guarantee the added permission will be retained if
the device is rebooted before it is written. |
void |
addPreferredActivity(IntentFilter filter,
int match,
ComponentName[] set,
ComponentName activity)
Deprecated.
|
String[] |
canonicalToCurrentPackageNames(String[] names)
Deprecated.
Map from a packages canonical name to the current name in use on the device.
|
int |
checkPermission(String permName,
String pkgName)
Deprecated.
Check whether a particular package has been granted a particular
permission.
|
int |
checkSignatures(int uid1,
int uid2)
Deprecated.
Like
PackageManager.checkSignatures(String, String) , but takes UIDs of
the two packages to be checked. |
int |
checkSignatures(String pkg1,
String pkg2)
Deprecated.
Compare the signatures of two packages to determine if the same
signature appears in both of them.
|
void |
clearApplicationUserData(String packageName,
IPackageDataObserver observer)
Deprecated.
Attempts to clear the user data directory of an application.
|
void |
clearCrossProfileIntentFilters(int sourceUserId)
Deprecated.
Clearing
CrossProfileIntentFilter s which have the specified user
as their source, and have been set by the app calling this method. |
void |
clearPackagePreferredActivities(String packageName)
Deprecated.
Remove all preferred activity mappings, previously added with
PackageManager.addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName) , from the
system whose activities are implemented in the given package name. |
String[] |
currentToCanonicalPackageNames(String[] names)
Deprecated.
Map from the current package names in use on the device to whatever
the current canonical name of that package is.
|
void |
deleteApplicationCacheFiles(String packageName,
IPackageDataObserver observer)
Deprecated.
Attempts to delete the cache files associated with an application.
|
void |
deleteApplicationCacheFilesAsUser(String packageName,
int userId,
IPackageDataObserver observer)
Deprecated.
Attempts to delete the cache files associated with an application for a given user.
|
void |
deletePackage(String packageName,
IPackageDeleteObserver observer,
int flags)
Deprecated.
Attempts to delete a package.
|
void |
deletePackageAsUser(String packageName,
IPackageDeleteObserver observer,
int flags,
int userId)
Deprecated.
Attempts to delete a package.
|
void |
extendVerificationTimeout(int id,
int verificationCodeAtTimeout,
long millisecondsToDelay)
Deprecated.
Allows a package listening to the
package verification
broadcast to extend the default timeout for a response and declare what
action to perform after the timeout occurs. |
void |
flushPackageRestrictionsAsUser(int userId)
Deprecated.
Flush the package restrictions for a given user to disk.
|
void |
freeStorage(String volumeUuid,
long idealStorageSize,
IntentSender pi)
Deprecated.
|
void |
freeStorageAndNotify(String volumeUuid,
long idealStorageSize,
IPackageDataObserver observer)
Deprecated.
|
Drawable |
getActivityBanner(ComponentName activityName)
Deprecated.
Retrieve the banner associated with an activity.
|
Drawable |
getActivityBanner(Intent intent)
Deprecated.
Retrieve the banner associated with an Intent.
|
Drawable |
getActivityIcon(ComponentName activityName)
Deprecated.
Retrieve the icon associated with an activity.
|
Drawable |
getActivityIcon(Intent intent)
Deprecated.
Retrieve the icon associated with an Intent.
|
ActivityInfo |
getActivityInfo(ComponentName className,
int flags)
Deprecated.
Retrieve all of the information we know about a particular activity
class.
|
Drawable |
getActivityLogo(ComponentName activityName)
Deprecated.
Retrieve the logo associated with an activity.
|
Drawable |
getActivityLogo(Intent intent)
Deprecated.
Retrieve the logo associated with an Intent.
|
List<IntentFilter> |
getAllIntentFilters(String packageName)
Deprecated.
Get the list of IntentFilter for a specific package.
|
List<PermissionGroupInfo> |
getAllPermissionGroups(int flags)
Deprecated.
Retrieve all of the known permission groups in the system.
|
Drawable |
getApplicationBanner(ApplicationInfo info)
Deprecated.
Retrieve the banner associated with an application.
|
Drawable |
getApplicationBanner(String packageName)
Deprecated.
Retrieve the banner associated with an application.
|
int |
getApplicationEnabledSetting(String packageName)
Deprecated.
Return the enabled setting for an application.
|
boolean |
getApplicationHiddenSettingAsUser(String packageName,
UserHandle user)
Deprecated.
Returns the hidden state of a package.
|
Drawable |
getApplicationIcon(ApplicationInfo info)
Deprecated.
Retrieve the icon associated with an application.
|
Drawable |
getApplicationIcon(String packageName)
Deprecated.
Retrieve the icon associated with an application.
|
ApplicationInfo |
getApplicationInfo(String packageName,
int flags)
Deprecated.
Retrieve all of the information we know about a particular
package/application.
|
ApplicationInfo |
getApplicationInfoAsUser(String packageName,
int flags,
int userId)
Deprecated.
|
CharSequence |
getApplicationLabel(ApplicationInfo info)
Deprecated.
Return the label to use for this application.
|
Drawable |
getApplicationLogo(ApplicationInfo info)
Deprecated.
Retrieve the logo associated with an application.
|
Drawable |
getApplicationLogo(String packageName)
Deprecated.
Retrieve the logo associated with an application.
|
int |
getComponentEnabledSetting(ComponentName componentName)
Deprecated.
Return the enabled setting for a package component (activity,
receiver, service, provider).
|
Drawable |
getDefaultActivityIcon()
Deprecated.
Return the generic icon for an activity that is used when no specific
icon is defined.
|
String |
getDefaultBrowserPackageName(int userId)
Deprecated.
|
String |
getDefaultBrowserPackageNameAsUser(int userId)
Deprecated.
|
Drawable |
getDrawable(String packageName,
int resid,
ApplicationInfo appInfo)
Deprecated.
Retrieve an image from a package.
|
Drawable |
getEphemeralApplicationIcon(String packageName)
Deprecated.
Gets the icon for an ephemeral application.
|
List<EphemeralApplicationInfo> |
getEphemeralApplications()
Deprecated.
Gets the ephemeral applications the user recently used.
|
byte[] |
getEphemeralCookie()
Deprecated.
Gets the ephemeral application cookie for this app.
|
int |
getEphemeralCookieMaxSizeBytes()
Deprecated.
Gets the maximum size in bytes of the cookie data an ephemeral app
can store on the device.
|
ComponentName |
getHomeActivities(List<ResolveInfo> outActivities)
Deprecated.
Ask for the set of available 'home' activities and the current explicit
default, if any.
|
List<ApplicationInfo> |
getInstalledApplications(int flags)
Deprecated.
Return a List of all application packages that are installed on the
device.
|
List<PackageInfo> |
getInstalledPackages(int flags)
Deprecated.
Return a List of all packages that are installed
on the device.
|
List<PackageInfo> |
getInstalledPackagesAsUser(int flags,
int userId)
Deprecated.
Return a List of all packages that are installed on the device, for a specific user.
|
String |
getInstallerPackageName(String packageName)
Deprecated.
Retrieve the package name of the application that installed a package.
|
InstrumentationInfo |
getInstrumentationInfo(ComponentName className,
int flags)
Deprecated.
Retrieve all of the information we know about a particular
instrumentation class.
|
List<IntentFilterVerificationInfo> |
getIntentFilterVerifications(String packageName)
Deprecated.
Get the list of IntentFilterVerificationInfo for a specific package and User.
|
int |
getIntentVerificationStatusAsUser(String packageName,
int userId)
Deprecated.
Get the status of a Domain Verification Result for an IntentFilter.
|
KeySet |
getKeySetByAlias(String packageName,
String alias)
Deprecated.
Return the
KeySet associated with the String alias for this
application. |
Intent |
getLaunchIntentForPackage(String packageName)
Deprecated.
Returns a "good" intent to launch a front-door activity in a package.
|
Intent |
getLeanbackLaunchIntentForPackage(String packageName)
Deprecated.
Return a "good" intent to launch a front-door Leanback activity in a
package, for use for example to implement an "open" button when browsing
through packages.
|
Drawable |
getManagedUserBadgedDrawable(Drawable drawable,
Rect badgeLocation,
int badgeDensity)
Deprecated.
Returns a managed-user-style badged copy of the given drawable allowing the user to
distinguish it from the original drawable.
|
int |
getMoveStatus(int moveId)
Deprecated.
|
String |
getNameForUid(int uid)
Deprecated.
Retrieve the official name associated with a user id.
|
PackageInfo |
getPackageArchiveInfo(String archiveFilePath,
int flags)
Deprecated.
Retrieve overall information about an application package defined
in a package archive file
|
List<VolumeInfo> |
getPackageCandidateVolumes(ApplicationInfo app)
Deprecated.
|
VolumeInfo |
getPackageCurrentVolume(ApplicationInfo app)
Deprecated.
|
int[] |
getPackageGids(String packageName)
Deprecated.
Return an array of all of the POSIX secondary group IDs that have been
assigned to the given package.
|
int[] |
getPackageGids(String packageName,
int flags)
Deprecated.
Return an array of all of the POSIX secondary group IDs that have been
assigned to the given package.
|
PackageInfo |
getPackageInfo(String packageName,
int flags)
Deprecated.
Retrieve overall information about an application package that is
installed on the system.
|
PackageInfo |
getPackageInfoAsUser(String packageName,
int flags,
int userId)
Deprecated.
|
PackageInstaller |
getPackageInstaller()
Deprecated.
|
String[] |
getPackagesForUid(int uid)
Deprecated.
Retrieve the names of all packages that are associated with a particular
user id.
|
List<PackageInfo> |
getPackagesHoldingPermissions(String[] permissions,
int flags)
Deprecated.
Return a List of all installed packages that are currently
holding any of the given permissions.
|
void |
getPackageSizeInfoAsUser(String packageName,
int userHandle,
IPackageStatsObserver observer)
Deprecated.
Retrieve the size information for a package.
|
int |
getPackageUid(String packageName,
int flags)
Deprecated.
Return the UID associated with the given package name.
|
int |
getPackageUidAsUser(String packageName,
int userHandle)
Deprecated.
Return the UID associated with the given package name.
|
int |
getPackageUidAsUser(String packageName,
int flags,
int userHandle)
Deprecated.
Return the UID associated with the given package name.
|
String |
getPermissionControllerPackageName()
Deprecated.
Gets the package name of the component controlling runtime permissions.
|
int |
getPermissionFlags(String permissionName,
String packageName,
UserHandle user)
Deprecated.
Gets the state flags associated with a permission.
|
PermissionGroupInfo |
getPermissionGroupInfo(String name,
int flags)
Deprecated.
Retrieve all of the information we know about a particular group of
permissions.
|
PermissionInfo |
getPermissionInfo(String name,
int flags)
Deprecated.
Retrieve all of the information we know about a particular permission.
|
int |
getPreferredActivities(List<IntentFilter> outFilters,
List<ComponentName> outActivities,
String packageName)
Deprecated.
Retrieve all preferred activities, previously added with
PackageManager.addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName) , that are
currently registered with the system. |
List<PackageInfo> |
getPreferredPackages(int flags)
Deprecated.
Retrieve the list of all currently configured preferred packages.
|
List<VolumeInfo> |
getPrimaryStorageCandidateVolumes()
Deprecated.
|
VolumeInfo |
getPrimaryStorageCurrentVolume()
Deprecated.
|
ProviderInfo |
getProviderInfo(ComponentName className,
int flags)
Deprecated.
Retrieve all of the information we know about a particular content
provider class.
|
ActivityInfo |
getReceiverInfo(ComponentName className,
int flags)
Deprecated.
Retrieve all of the information we know about a particular receiver
class.
|
Resources |
getResourcesForActivity(ComponentName activityName)
Deprecated.
Retrieve the resources associated with an activity.
|
Resources |
getResourcesForApplication(ApplicationInfo app)
Deprecated.
Retrieve the resources for an application.
|
Resources |
getResourcesForApplication(String appPackageName)
Deprecated.
Retrieve the resources associated with an application.
|
Resources |
getResourcesForApplicationAsUser(String appPackageName,
int userId)
Deprecated.
|
ServiceInfo |
getServiceInfo(ComponentName className,
int flags)
Deprecated.
Retrieve all of the information we know about a particular service class.
|
String |
getServicesSystemSharedLibraryPackageName()
Deprecated.
Get the name of the package hosting the services shared library.
|
String |
getSharedSystemSharedLibraryPackageName()
Deprecated.
Get the name of the package hosting the shared components shared library.
|
KeySet |
getSigningKeySet(String packageName)
Deprecated.
Return the signing
KeySet for this application. |
FeatureInfo[] |
getSystemAvailableFeatures()
Deprecated.
Get a list of features that are available on the
system.
|
String[] |
getSystemSharedLibraryNames()
Deprecated.
Get a list of shared libraries that are available on the
system.
|
CharSequence |
getText(String packageName,
int resid,
ApplicationInfo appInfo)
Deprecated.
Retrieve text from a package.
|
int |
getUidForSharedUser(String sharedUserName)
Deprecated.
Return the user id associated with a shared user name.
|
Drawable |
getUserBadgedDrawableForDensity(Drawable drawable,
UserHandle user,
Rect badgeLocation,
int badgeDensity)
Deprecated.
If the target user is a managed profile of the calling user or the caller
is itself a managed profile, then this returns a badged copy of the given
drawable allowing the user to distinguish it from the original drawable.
|
Drawable |
getUserBadgedIcon(Drawable icon,
UserHandle user)
Deprecated.
If the target user is a managed profile, then this returns a badged copy of the given icon
to be able to distinguish it from the original icon.
|
CharSequence |
getUserBadgedLabel(CharSequence label,
UserHandle user)
Deprecated.
If the target user is a managed profile of the calling user or the caller
is itself a managed profile, then this returns a copy of the label with
badging for accessibility services like talkback.
|
Drawable |
getUserBadgeForDensity(UserHandle user,
int density)
Deprecated.
If the target user is a managed profile of the calling user or the caller
is itself a managed profile, then this returns a drawable to use as a small
icon to include in a view to distinguish it from the original icon.
|
Drawable |
getUserBadgeForDensityNoBackground(UserHandle user,
int density)
Deprecated.
If the target user is a managed profile of the calling user or the caller
is itself a managed profile, then this returns a drawable to use as a small
icon to include in a view to distinguish it from the original icon.
|
VerifierDeviceIdentity |
getVerifierDeviceIdentity()
Deprecated.
Returns the device identity that verifiers can use to associate their scheme to a particular
device.
|
XmlResourceParser |
getXml(String packageName,
int resid,
ApplicationInfo appInfo)
Deprecated.
Retrieve an XML file from a package.
|
void |
grantRuntimePermission(String packageName,
String permissionName,
UserHandle user)
Deprecated.
Grant a runtime permission to an application which the application does not
already have.
|
boolean |
hasSystemFeature(String name)
Deprecated.
Check whether the given feature name is one of the available features as
returned by
PackageManager.getSystemAvailableFeatures() . |
boolean |
hasSystemFeature(String name,
int version)
Deprecated.
Check whether the given feature name and version is one of the available
features as returned by
PackageManager.getSystemAvailableFeatures() . |
int |
installExistingPackage(String packageName)
Deprecated.
If there is already an application with the given package name installed
on the system for other users, also install it for the calling user.
|
int |
installExistingPackageAsUser(String packageName,
int userId)
Deprecated.
If there is already an application with the given package name installed
on the system for other users, also install it for the specified user.
|
void |
installPackage(Uri packageURI,
IPackageInstallObserver observer,
int flags,
String installerPackageName)
Deprecated.
|
boolean |
isEphemeralApplication()
Deprecated.
Gets whether the caller is an ephemeral app.
|
boolean |
isPackageAvailable(String packageName)
Deprecated.
|
boolean |
isPackageSuspendedForUser(String packageName,
int userId)
Deprecated.
|
boolean |
isPermissionRevokedByPolicy(String permName,
String pkgName)
Deprecated.
Checks whether a particular permissions has been revoked for a
package by policy.
|
boolean |
isSafeMode()
Deprecated.
Return whether the device has been booted into safe mode.
|
boolean |
isSignedBy(String packageName,
KeySet ks)
Deprecated.
Return whether the package denoted by packageName has been signed by all
of the keys specified by the
KeySet ks. |
boolean |
isSignedByExactly(String packageName,
KeySet ks)
Deprecated.
Return whether the package denoted by packageName has been signed by all
of, and only, the keys specified by the
KeySet ks. |
boolean |
isUpgrade()
Deprecated.
Returns true if the device is upgrading, such as first boot after OTA.
|
Drawable |
loadItemIcon(PackageItemInfo itemInfo,
ApplicationInfo appInfo)
Deprecated.
|
Drawable |
loadUnbadgedItemIcon(PackageItemInfo itemInfo,
ApplicationInfo appInfo)
Deprecated.
|
int |
movePackage(String packageName,
VolumeInfo vol)
Deprecated.
|
int |
movePrimaryStorage(VolumeInfo vol)
Deprecated.
|
List<ResolveInfo> |
queryBroadcastReceivers(Intent intent,
int flags)
Deprecated.
Retrieve all receivers that can handle a broadcast of the given intent.
|
List<ResolveInfo> |
queryBroadcastReceiversAsUser(Intent intent,
int flags,
int userId)
Deprecated.
|
List<ProviderInfo> |
queryContentProviders(String processName,
int uid,
int flags)
Deprecated.
Retrieve content provider information.
|
List<InstrumentationInfo> |
queryInstrumentation(String targetPackage,
int flags)
Deprecated.
Retrieve information about available instrumentation code.
|
List<ResolveInfo> |
queryIntentActivities(Intent intent,
int flags)
Deprecated.
Retrieve all activities that can be performed for the given intent.
|
List<ResolveInfo> |
queryIntentActivitiesAsUser(Intent intent,
int flags,
int userId)
Deprecated.
Retrieve all activities that can be performed for the given intent, for a
specific user.
|
List<ResolveInfo> |
queryIntentActivityOptions(ComponentName caller,
Intent[] specifics,
Intent intent,
int flags)
Deprecated.
Retrieve a set of activities that should be presented to the user as
similar options.
|
List<ResolveInfo> |
queryIntentContentProviders(Intent intent,
int flags)
Deprecated.
Retrieve all providers that can match the given intent.
|
List<ResolveInfo> |
queryIntentContentProvidersAsUser(Intent intent,
int flags,
int userId)
Deprecated.
Retrieve all providers that can match the given intent.
|
List<ResolveInfo> |
queryIntentServices(Intent intent,
int flags)
Deprecated.
Retrieve all services that can match the given intent.
|
List<ResolveInfo> |
queryIntentServicesAsUser(Intent intent,
int flags,
int userId)
Deprecated.
Retrieve all services that can match the given intent for a given user.
|
List<PermissionInfo> |
queryPermissionsByGroup(String group,
int flags)
Deprecated.
Query for all of the permissions associated with a particular group.
|
void |
registerMoveCallback(PackageManager.MoveCallback callback,
Handler handler)
Deprecated.
|
void |
removeOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
Deprecated.
Remvoes a listener for permission changes for installed packages.
|
void |
removePackageFromPreferred(String packageName)
Deprecated.
|
void |
removePermission(String name)
Deprecated.
Removes a permission that was previously added with
PackageManager.addPermission(PermissionInfo) . |
void |
replacePreferredActivity(IntentFilter filter,
int match,
ComponentName[] set,
ComponentName activity)
Deprecated.
|
ResolveInfo |
resolveActivity(Intent intent,
int flags)
Deprecated.
Determine the best action to perform for a given Intent.
|
ResolveInfo |
resolveActivityAsUser(Intent intent,
int flags,
int userId)
Deprecated.
Determine the best action to perform for a given Intent for a given user.
|
ProviderInfo |
resolveContentProvider(String name,
int flags)
Deprecated.
Find a single content provider by its base path name.
|
ProviderInfo |
resolveContentProviderAsUser(String name,
int flags,
int userId)
Deprecated.
Find a single content provider by its base path name.
|
ResolveInfo |
resolveService(Intent intent,
int flags)
Deprecated.
Determine the best service to handle for a given Intent.
|
void |
revokeRuntimePermission(String packageName,
String permissionName,
UserHandle user)
Deprecated.
Revoke a runtime permission that was previously granted by
PackageManager.grantRuntimePermission(String, String, android.os.UserHandle) . |
void |
setApplicationEnabledSetting(String packageName,
int newState,
int flags)
Deprecated.
Set the enabled setting for an application
This setting will override any enabled state which may have been set by the application in
its manifest.
|
boolean |
setApplicationHiddenSettingAsUser(String packageName,
boolean hidden,
UserHandle user)
Deprecated.
Puts the package in a hidden state, which is almost like an uninstalled state,
making the package unavailable, but it doesn't remove the data or the actual
package file.
|
void |
setComponentEnabledSetting(ComponentName componentName,
int newState,
int flags)
Deprecated.
Set the enabled setting for a package component (activity, receiver, service, provider).
|
boolean |
setDefaultBrowserPackageName(String packageName,
int userId)
Deprecated.
|
boolean |
setDefaultBrowserPackageNameAsUser(String packageName,
int userId)
Deprecated.
|
boolean |
setEphemeralCookie(byte[] cookie)
Deprecated.
Sets the ephemeral application cookie for the calling app.
|
void |
setInstallerPackageName(String targetPackage,
String installerPackageName)
Deprecated.
Change the installer associated with a given package.
|
String[] |
setPackagesSuspendedAsUser(String[] packageNames,
boolean hidden,
int userId)
Deprecated.
Puts the package in a suspended state, where attempts at starting activities are denied.
|
boolean |
shouldShowRequestPermissionRationale(String permission)
Deprecated.
Gets whether you should show UI with rationale for requesting a permission.
|
void |
unregisterMoveCallback(PackageManager.MoveCallback callback)
Deprecated.
|
boolean |
updateIntentVerificationStatusAsUser(String packageName,
int status,
int userId)
Deprecated.
Allow to change the status of a Intent Verification status for all IntentFilter of an App.
|
void |
updatePermissionFlags(String permissionName,
String packageName,
int flagMask,
int flagValues,
UserHandle user)
Deprecated.
Updates the flags associated with a permission by replacing the flags in
the specified mask with the provided flag values.
|
void |
verifyIntentFilter(int id,
int verificationCode,
List<String> outFailedDomains)
Deprecated.
Allows a package listening to the
Intent.ACTION_INTENT_FILTER_NEEDS_VERIFICATION intent filter verification
broadcast to respond to the package manager. |
void |
verifyPendingInstall(int id,
int verificationCode)
Deprecated.
Allows a package listening to the
package verification
broadcast to respond to the package manager. |
addPreferredActivityAsUser, buildRequestPermissionsIntent, deleteStatusToPublicStatus, deleteStatusToString, deleteStatusToString, freeStorage, freeStorageAndNotify, getPackageSizeInfo, installStatusToPublicStatus, installStatusToString, installStatusToString, isMoveStatusFinished, permissionFlagToString, queryBroadcastReceivers, queryBroadcastReceiversAsUser, replacePreferredActivityAsUser
public PackageInfo getPackageInfo(String packageName, int flags) throws PackageManager.NameNotFoundException
PackageManager
getPackageInfo
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.flags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.MATCH_UNINSTALLED_PACKAGES
is set and if the
package is not found in the list of installed applications, the
package information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DONT_DELETE_DATA
flag set).PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public PackageInfo getPackageInfoAsUser(String packageName, int flags, int userId) throws PackageManager.NameNotFoundException
getPackageInfoAsUser
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.flags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.userId
- The user id.MATCH_UNINSTALLED_PACKAGES
is set and if the
package is not found in the list of installed applications, the
package information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DONT_DELETE_DATA
flag set).PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public String[] currentToCanonicalPackageNames(String[] names)
PackageManager
currentToCanonicalPackageNames
in class PackageManager
names
- Array of current names to be mapped.public String[] canonicalToCurrentPackageNames(String[] names)
PackageManager
canonicalToCurrentPackageNames
in class PackageManager
names
- Array of new names to be mapped.public Intent getLaunchIntentForPackage(String packageName)
PackageManager
Intent.CATEGORY_INFO
, and next for a
main activity in the category Intent.CATEGORY_LAUNCHER
. Returns
null
if neither are found.getLaunchIntentForPackage
in class PackageManager
packageName
- The name of the package to inspect.Intent
that can be used to launch the
main activity in the package. Returns null
if the package
does not contain such an activity, or if packageName is not
recognized.public Intent getLeanbackLaunchIntentForPackage(String packageName)
PackageManager
Intent.CATEGORY_LEANBACK_LAUNCHER
, or
return null if no main leanback activities are found.getLeanbackLaunchIntentForPackage
in class PackageManager
packageName
- The name of the package to inspect.public int[] getPackageGids(String packageName) throws PackageManager.NameNotFoundException
PackageManager
Note that the same package may have different GIDs under different
UserHandle
on the same device.
getPackageGids
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.public int[] getPackageGids(String packageName, int flags) throws PackageManager.NameNotFoundException
PackageManager
Note that the same package may have different GIDs under different
UserHandle
on the same device.
getPackageGids
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.public int getPackageUid(String packageName, int flags) throws PackageManager.NameNotFoundException
PackageManager
Note that the same package will have different UIDs under different
UserHandle
on the same device.
getPackageUid
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.PackageManager.NameNotFoundException
- if a package with the given name can not be
found on the system.public int getPackageUidAsUser(String packageName, int flags, int userHandle) throws PackageManager.NameNotFoundException
PackageManager
Note that the same package will have different UIDs under different
UserHandle
on the same device.
getPackageUidAsUser
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.userHandle
- The user handle identifier to look up the package under.PackageManager.NameNotFoundException
- if a package with the given name can not be
found on the system.public int getPackageUidAsUser(String packageName, int userHandle) throws PackageManager.NameNotFoundException
PackageManager
Note that the same package will have different UIDs under different
UserHandle
on the same device.
getPackageUidAsUser
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.userHandle
- The user handle identifier to look up the package under.PackageManager.NameNotFoundException
- if a package with the given name can not be
found on the system.public PermissionInfo getPermissionInfo(String name, int flags) throws PackageManager.NameNotFoundException
PackageManager
getPermissionInfo
in class PackageManager
name
- The fully qualified name (i.e. com.google.permission.LOGIN)
of the permission you are interested in.flags
- Additional option flags. Use PackageManager.GET_META_DATA
to
retrieve any meta-data associated with the permission.PermissionInfo
containing information about the
permission.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
public List<PermissionInfo> queryPermissionsByGroup(String group, int flags) throws PackageManager.NameNotFoundException
PackageManager
queryPermissionsByGroup
in class PackageManager
group
- The fully qualified name (i.e. com.google.permission.LOGIN)
of the permission group you are interested in. Use null to
find all of the permissions not associated with a group.flags
- Additional option flags. Use PackageManager.GET_META_DATA
to
retrieve any meta-data associated with the permissions.PermissionInfo
containing information
about all of the permissions in the given group.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
public PermissionGroupInfo getPermissionGroupInfo(String name, int flags) throws PackageManager.NameNotFoundException
PackageManager
getPermissionGroupInfo
in class PackageManager
name
- The fully qualified name (i.e. com.google.permission_group.APPS)
of the permission you are interested in.flags
- Additional option flags. Use PackageManager.GET_META_DATA
to
retrieve any meta-data associated with the permission group.PermissionGroupInfo
containing information
about the permission.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
public List<PermissionGroupInfo> getAllPermissionGroups(int flags)
PackageManager
getAllPermissionGroups
in class PackageManager
flags
- Additional option flags. Use PackageManager.GET_META_DATA
to
retrieve any meta-data associated with the permission group.PermissionGroupInfo
containing
information about all of the known permission groups.PackageManager.GET_META_DATA
public ApplicationInfo getApplicationInfo(String packageName, int flags) throws PackageManager.NameNotFoundException
PackageManager
getApplicationInfo
in class PackageManager
packageName
- The full name (i.e. com.google.apps.contacts) of an
application.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_SYSTEM_ONLY
, PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.ApplicationInfo
containing information about the
package. If flag MATCH_UNINSTALLED_PACKAGES
is set and if the
package is not found in the list of installed applications, the
application information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DONT_DELETE_DATA
flag set).PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ApplicationInfo getApplicationInfoAsUser(String packageName, int flags, int userId) throws PackageManager.NameNotFoundException
PackageManager
getApplicationInfoAsUser
in class PackageManager
PackageManager.NameNotFoundException
public ActivityInfo getActivityInfo(ComponentName className, int flags) throws PackageManager.NameNotFoundException
PackageManager
getActivityInfo
in class PackageManager
className
- The full component name (i.e.
com.google.apps.contacts/com.google.apps.contacts.
ContactsList) of an Activity class.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ActivityInfo
containing information about the
activity.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ActivityInfo getReceiverInfo(ComponentName className, int flags) throws PackageManager.NameNotFoundException
PackageManager
getReceiverInfo
in class PackageManager
className
- The full component name (i.e.
com.google.apps.calendar/com.google.apps.calendar.
CalendarAlarm) of a Receiver class.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ActivityInfo
containing information about the
receiver.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ServiceInfo getServiceInfo(ComponentName className, int flags) throws PackageManager.NameNotFoundException
PackageManager
getServiceInfo
in class PackageManager
className
- The full component name (i.e.
com.google.apps.media/com.google.apps.media.
BackgroundPlayback) of a Service class.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ServiceInfo
object containing information about the
service.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ProviderInfo getProviderInfo(ComponentName className, int flags) throws PackageManager.NameNotFoundException
PackageManager
getProviderInfo
in class PackageManager
className
- The full component name (i.e.
com.google.providers.media/com.google.providers.media.
MediaProvider) of a ContentProvider class.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ProviderInfo
object containing information about the
provider.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<PackageInfo> getInstalledPackages(int flags)
PackageManager
getInstalledPackages
in class PackageManager
flags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.MATCH_UNINSTALLED_PACKAGES
is set, the package
information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DONT_DELETE_DATA
flag set).PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<PackageInfo> getPackagesHoldingPermissions(String[] permissions, int flags)
PackageManager
getPackagesHoldingPermissions
in class PackageManager
flags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.MATCH_UNINSTALLED_PACKAGES
is set, the package information
is retrieved from the list of uninstalled applications (which
includes installed applications as well as applications with data
directory i.e. applications which had been deleted with
DONT_DELETE_DATA
flag set).PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<PackageInfo> getInstalledPackagesAsUser(int flags, int userId)
PackageManager
getInstalledPackagesAsUser
in class PackageManager
flags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.userId
- The user for whom the installed packages are to be listedMATCH_UNINSTALLED_PACKAGES
is set, the package
information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DONT_DELETE_DATA
flag set).PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public int checkPermission(String permName, String pkgName)
PackageManager
checkPermission
in class PackageManager
permName
- The name of the permission you are checking for.pkgName
- The name of the package you are checking against.PackageManager.PERMISSION_GRANTED
,
PackageManager.PERMISSION_DENIED
public boolean isPermissionRevokedByPolicy(String permName, String pkgName)
PackageManager
isPermissionRevokedByPolicy
in class PackageManager
permName
- The name of the permission you are checking for.pkgName
- The name of the package you are checking against.public String getPermissionControllerPackageName()
PackageManager
getPermissionControllerPackageName
in class PackageManager
public boolean addPermission(PermissionInfo info)
PackageManager
<permission-tree>
tag in its manifest. A package can only add
permissions to trees that were defined by either its own package or
another with the same user id; a permission is in a tree if it
matches the name of the permission tree + ".": for example,
"com.foo.bar" is a member of the permission tree "com.foo".
It is good to make your permission tree name descriptive, because you are taking possession of that entire set of permission names. Thus, it must be under a domain you control, with a suffix that will not match any normal permissions that may be declared in any applications that are part of that domain.
New permissions must be added before any .apks are installed that use those permissions. Permissions you add through this method are remembered across reboots of the device. If the given permission already exists, the info you supply here will be used to update it.
addPermission
in class PackageManager
info
- Description of the permission to be added.PackageManager.removePermission(String)
public boolean addPermissionAsync(PermissionInfo info)
PackageManager
PackageManager.addPermission(PermissionInfo)
but asynchronously
persists the package manager state after returning from the call,
allowing it to return quicker and batch a series of adds at the
expense of no guarantee the added permission will be retained if
the device is rebooted before it is written.addPermissionAsync
in class PackageManager
public void removePermission(String name)
PackageManager
PackageManager.addPermission(PermissionInfo)
. The same ownership rules apply
-- you are only allowed to remove permissions that you are allowed
to add.removePermission
in class PackageManager
name
- The name of the permission to remove.PackageManager.addPermission(PermissionInfo)
public void grantRuntimePermission(String packageName, String permissionName, UserHandle user)
PackageManager
SecurityException
is thrown.
Note: Using this API requires holding android.permission.GRANT_REVOKE_PERMISSIONS and if the user id is not the current user android.permission.INTERACT_ACROSS_USERS_FULL.
grantRuntimePermission
in class PackageManager
packageName
- The package to which to grant the permission.permissionName
- The permission name to grant.user
- The user for which to grant the permission.PackageManager.revokeRuntimePermission(String, String, android.os.UserHandle)
,
PackageManager.PermissionFlags
public void revokeRuntimePermission(String packageName, String permissionName, UserHandle user)
PackageManager
PackageManager.grantRuntimePermission(String, String, android.os.UserHandle)
. The
permission must have been requested by and granted to the application.
If the application is not allowed to hold the permission, a SecurityException
is thrown.
Note: Using this API requires holding android.permission.GRANT_REVOKE_PERMISSIONS and if the user id is not the current user android.permission.INTERACT_ACROSS_USERS_FULL.
revokeRuntimePermission
in class PackageManager
packageName
- The package from which to revoke the permission.permissionName
- The permission name to revoke.user
- The user for which to revoke the permission.PackageManager.grantRuntimePermission(String, String, android.os.UserHandle)
,
PackageManager.PermissionFlags
public int getPermissionFlags(String permissionName, String packageName, UserHandle user)
PackageManager
getPermissionFlags
in class PackageManager
permissionName
- The permission for which to get the flags.packageName
- The package name for which to get the flags.user
- The user for which to get permission flags.public void updatePermissionFlags(String permissionName, String packageName, int flagMask, int flagValues, UserHandle user)
PackageManager
updatePermissionFlags
in class PackageManager
permissionName
- The permission for which to update the flags.packageName
- The package name for which to update the flags.flagMask
- The flags which to replace.flagValues
- The flags with which to replace.user
- The user for which to update the permission flags.public boolean shouldShowRequestPermissionRationale(String permission)
PackageManager
shouldShowRequestPermissionRationale
in class PackageManager
permission
- A permission your app wants to request.public void addOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
PackageManager
addOnPermissionsChangeListener
in class PackageManager
listener
- The listener to add.public void removeOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
PackageManager
removeOnPermissionsChangeListener
in class PackageManager
listener
- The listener to remove.public int checkSignatures(String pkg1, String pkg2)
PackageManager
checkSignatures
in class PackageManager
pkg1
- First package name whose signature will be compared.pkg2
- Second package name whose signature will be compared.PackageManager.SIGNATURE_MATCH
) if
all signatures match or < 0 if there is not a match (PackageManager.SIGNATURE_NO_MATCH
or PackageManager.SIGNATURE_UNKNOWN_PACKAGE
).PackageManager.checkSignatures(int, int)
,
PackageManager.SIGNATURE_MATCH
,
PackageManager.SIGNATURE_NO_MATCH
,
PackageManager.SIGNATURE_UNKNOWN_PACKAGE
public int checkSignatures(int uid1, int uid2)
PackageManager
PackageManager.checkSignatures(String, String)
, but takes UIDs of
the two packages to be checked. This can be useful, for example,
when doing the check in an IPC, where the UID is the only identity
available. It is functionally identical to determining the package
associated with the UIDs and checking their signatures.checkSignatures
in class PackageManager
uid1
- First UID whose signature will be compared.uid2
- Second UID whose signature will be compared.PackageManager.SIGNATURE_MATCH
) if
all signatures match or < 0 if there is not a match (PackageManager.SIGNATURE_NO_MATCH
or PackageManager.SIGNATURE_UNKNOWN_PACKAGE
).PackageManager.checkSignatures(String, String)
,
PackageManager.SIGNATURE_MATCH
,
PackageManager.SIGNATURE_NO_MATCH
,
PackageManager.SIGNATURE_UNKNOWN_PACKAGE
public String[] getPackagesForUid(int uid)
PackageManager
getPackagesForUid
in class PackageManager
uid
- The user id for which you would like to retrieve the
associated packages.public String getNameForUid(int uid)
PackageManager
getNameForUid
in class PackageManager
uid
- The user id for which you would like to retrieve a name.public int getUidForSharedUser(String sharedUserName)
PackageManager
getUidForSharedUser
in class PackageManager
sharedUserName
- The shared user name whose uid is to be retrieved.public List<ApplicationInfo> getInstalledApplications(int flags)
PackageManager
DONT_DELETE_DATA
(partially
installed apps with data directory) will be returned.getInstalledApplications
in class PackageManager
flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_SYSTEM_ONLY
, PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.MATCH_UNINSTALLED_PACKAGES
is set, the
application information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DONT_DELETE_DATA
flag set).PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<EphemeralApplicationInfo> getEphemeralApplications()
PackageManager
getEphemeralApplications
in class PackageManager
public Drawable getEphemeralApplicationIcon(String packageName)
PackageManager
getEphemeralApplicationIcon
in class PackageManager
packageName
- The app package name.public byte[] getEphemeralCookie()
PackageManager
getEphemeralCookie
in class PackageManager
PackageManager.isEphemeralApplication()
,
PackageManager.setEphemeralCookie(byte[])
,
PackageManager.getEphemeralCookieMaxSizeBytes()
public boolean isEphemeralApplication()
PackageManager
isEphemeralApplication
in class PackageManager
PackageManager.setEphemeralCookie(byte[])
,
PackageManager.getEphemeralCookie()
,
PackageManager.getEphemeralCookieMaxSizeBytes()
public int getEphemeralCookieMaxSizeBytes()
PackageManager
getEphemeralCookieMaxSizeBytes
in class PackageManager
PackageManager.isEphemeralApplication()
,
PackageManager.setEphemeralCookie(byte[])
,
PackageManager.getEphemeralCookie()
public boolean setEphemeralCookie(byte[] cookie)
PackageManager
PackageManager.getEphemeralCookieMaxSizeBytes()
.setEphemeralCookie
in class PackageManager
cookie
- The cookie data.PackageManager.isEphemeralApplication()
,
PackageManager.getEphemeralCookieMaxSizeBytes()
,
PackageManager.getEphemeralCookie()
public ResolveInfo resolveActivity(Intent intent, int flags)
PackageManager
Intent.resolveActivity(android.content.pm.PackageManager)
finds an activity if a class has not been
explicitly specified.
Note: if using an implicit Intent (without an explicit
ComponentName specified), be sure to consider whether to set the
PackageManager.MATCH_DEFAULT_ONLY
only flag. You need to do so to resolve the
activity in the same way that
Context.startActivity(Intent)
and
Intent.resolveActivity(PackageManager)
do.
resolveActivity
in class PackageManager
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is PackageManager.MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId)
PackageManager
Intent.resolveActivity(android.content.pm.PackageManager)
finds an activity if a class
has not been explicitly specified.
Note: if using an implicit Intent (without an explicit
ComponentName specified), be sure to consider whether to set the
PackageManager.MATCH_DEFAULT_ONLY
only flag. You need to do so to resolve the
activity in the same way that
Context.startActivity(Intent)
and
Intent.resolveActivity(PackageManager)
do.
resolveActivityAsUser
in class PackageManager
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is PackageManager.MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
.userId
- The user id.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentActivities(Intent intent, int flags)
PackageManager
queryIntentActivities
in class PackageManager
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is PackageManager.MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
. Or, set
PackageManager.MATCH_ALL
to prevent any filtering of the results.PackageManager.resolveActivity(android.content.Intent, int)
. If there are no matching activities, an
empty list is returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, int flags, int userId)
PackageManager
queryIntentActivitiesAsUser
in class PackageManager
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is PackageManager.MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
. Or, set
PackageManager.MATCH_ALL
to prevent any filtering of the results.PackageManager.resolveActivity(android.content.Intent, int)
. If there are no matching activities, an
empty list is returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentActivityOptions(ComponentName caller, Intent[] specifics, Intent intent, int flags)
PackageManager
PackageManager.queryIntentActivities(android.content.Intent, int)
, except it
also allows you to supply a list of more explicit Intents that you would
like to resolve to particular options, and takes care of returning the
final ResolveInfo list in a reasonable order, with no duplicates, based
on those inputs.queryIntentActivityOptions
in class PackageManager
caller
- The class name of the activity that is making the request.
This activity will never appear in the output list. Can be
null.specifics
- An array of Intents that should be resolved to the first
specific results. Can be null.intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is PackageManager.MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags)
PackageManager
queryBroadcastReceivers
in class PackageManager
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, int flags, int userId)
queryBroadcastReceiversAsUser
in class PackageManager
public ResolveInfo resolveService(Intent intent, int flags)
PackageManager
resolveService
in class PackageManager
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentServices(Intent intent, int flags)
PackageManager
queryIntentServices
in class PackageManager
intent
- The desired intent as per resolveService().flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.PackageManager.resolveService(android.content.Intent, int)
. If there are no matching services, an
empty list or null is returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentServicesAsUser(Intent intent, int flags, int userId)
PackageManager
queryIntentServicesAsUser
in class PackageManager
intent
- The desired intent as per resolveService().flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.userId
- The user id.PackageManager.resolveService(android.content.Intent, int)
. If there are no matching services, an
empty list or null is returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentContentProvidersAsUser(Intent intent, int flags, int userId)
PackageManager
queryIntentContentProvidersAsUser
in class PackageManager
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.userId
- The user id.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags)
PackageManager
queryIntentContentProviders
in class PackageManager
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
, PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.PackageManager.GET_META_DATA
,
PackageManager.GET_RESOLVED_FILTER
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ProviderInfo resolveContentProvider(String name, int flags)
PackageManager
resolveContentProvider
in class PackageManager
name
- The name of the provider to find.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ProviderInfo
object containing information about the
provider. If a provider was not found, returns null.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public ProviderInfo resolveContentProviderAsUser(String name, int flags, int userId)
PackageManager
resolveContentProviderAsUser
in class PackageManager
name
- The name of the provider to find.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.userId
- The user id.ProviderInfo
object containing information about the
provider. If a provider was not found, returns null.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public List<ProviderInfo> queryContentProviders(String processName, int uid, int flags)
PackageManager
Note: unlike most other methods, an empty result set is indicated by a null return instead of an empty list.
queryContentProviders
in class PackageManager
processName
- If non-null, limits the returned providers to only
those that are hosted by the given process. If null, all
content providers are returned.uid
- If processName is non-null, this is the required
uid owning the requested content providers.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
, PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
, PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
, PackageManager.MATCH_SYSTEM_ONLY
or PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ProviderInfo
objects containing one entry for
each provider either matching processName or, if
processName is null, all known content providers.
If there are no matching providers, null is returned.PackageManager.GET_META_DATA
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.MATCH_ALL
,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
,
PackageManager.MATCH_DEFAULT_ONLY
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_DIRECT_BOOT_AWARE
,
PackageManager.MATCH_DIRECT_BOOT_UNAWARE
,
PackageManager.MATCH_SYSTEM_ONLY
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public InstrumentationInfo getInstrumentationInfo(ComponentName className, int flags) throws PackageManager.NameNotFoundException
PackageManager
getInstrumentationInfo
in class PackageManager
className
- The full name (i.e.
com.google.apps.contacts.InstrumentList) of an
Instrumentation class.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
to modify the data returned.InstrumentationInfo
object containing information about the
instrumentation.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.PackageManager.GET_META_DATA
public List<InstrumentationInfo> queryInstrumentation(String targetPackage, int flags)
PackageManager
queryInstrumentation
in class PackageManager
targetPackage
- If null, all instrumentation is returned; only the
instrumentation targeting this package name is
returned.flags
- Additional option flags. Use any combination of
PackageManager.GET_META_DATA
to modify the data returned.InstrumentationInfo
objects containing one
entry for each matching instrumentation. If there are no
instrumentation available, returns an empty list.PackageManager.GET_META_DATA
public Drawable getDrawable(String packageName, int resid, ApplicationInfo appInfo)
PackageManager
ComponentInfo
to implement retrieval of their associated
icon.getDrawable
in class PackageManager
packageName
- The name of the package that this icon is coming from.
Cannot be null.resid
- The resource identifier of the desired image. Cannot be 0.appInfo
- Overall information about packageName. This
may be null, in which case the application information will be retrieved
for you if needed; if you already have this information around, it can
be much more efficient to supply it here.public Drawable getActivityIcon(ComponentName activityName) throws PackageManager.NameNotFoundException
PackageManager
ComponentInfo.loadIcon()
to return its icon.
If the activity cannot be found, NameNotFoundException is thrown.getActivityIcon
in class PackageManager
activityName
- Name of the activity whose icon is to be retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
activity could not be loaded.PackageManager.getActivityIcon(Intent)
public Drawable getActivityIcon(Intent intent) throws PackageManager.NameNotFoundException
PackageManager
getActivityIcon
in class PackageManager
intent
- The intent for which you would like to retrieve an icon.PackageManager.NameNotFoundException
- Thrown if the resources for application
matching the given intent could not be loaded.PackageManager.getActivityIcon(ComponentName)
public Drawable getDefaultActivityIcon()
PackageManager
getDefaultActivityIcon
in class PackageManager
public Drawable getActivityBanner(ComponentName activityName) throws PackageManager.NameNotFoundException
PackageManager
ComponentInfo.loadIcon()
to return its
banner. If the activity cannot be found, NameNotFoundException is thrown.getActivityBanner
in class PackageManager
activityName
- Name of the activity whose banner is to be retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
activity could not be loaded.PackageManager.getActivityBanner(Intent)
public Drawable getActivityBanner(Intent intent) throws PackageManager.NameNotFoundException
PackageManager
getActivityBanner
in class PackageManager
intent
- The intent for which you would like to retrieve a banner.PackageManager.NameNotFoundException
- Thrown if the resources for application
matching the given intent could not be loaded.PackageManager.getActivityBanner(ComponentName)
public Drawable getApplicationBanner(ApplicationInfo info)
PackageManager
getApplicationBanner
in class PackageManager
info
- Information about application being queried.PackageManager.getApplicationBanner(String)
public Drawable getApplicationBanner(String packageName) throws PackageManager.NameNotFoundException
PackageManager
getApplicationBanner
in class PackageManager
packageName
- Name of the package whose application banner is to be
retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
application could not be loaded.PackageManager.getApplicationBanner(ApplicationInfo)
public Drawable getApplicationIcon(ApplicationInfo info)
PackageManager
getApplicationIcon
in class PackageManager
info
- Information about application being queried.PackageManager.getApplicationIcon(String)
public Drawable getApplicationIcon(String packageName) throws PackageManager.NameNotFoundException
PackageManager
getApplicationIcon
in class PackageManager
packageName
- Name of the package whose application icon is to be
retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
application could not be loaded.PackageManager.getApplicationIcon(ApplicationInfo)
public Drawable getActivityLogo(ComponentName activityName) throws PackageManager.NameNotFoundException
PackageManager
ComponentInfo.loadLogo()
to return its
logo. If the activity cannot be found, NameNotFoundException is thrown.getActivityLogo
in class PackageManager
activityName
- Name of the activity whose logo is to be retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
activity could not be loaded.PackageManager.getActivityLogo(Intent)
public Drawable getActivityLogo(Intent intent) throws PackageManager.NameNotFoundException
PackageManager
getActivityLogo
in class PackageManager
intent
- The intent for which you would like to retrieve a logo.PackageManager.NameNotFoundException
- Thrown if the resources for application
matching the given intent could not be loaded.PackageManager.getActivityLogo(ComponentName)
public Drawable getApplicationLogo(ApplicationInfo info)
PackageManager
getApplicationLogo
in class PackageManager
info
- Information about application being queried.PackageManager.getApplicationLogo(String)
public Drawable getApplicationLogo(String packageName) throws PackageManager.NameNotFoundException
PackageManager
getApplicationLogo
in class PackageManager
packageName
- Name of the package whose application logo is to be
retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
application could not be loaded.PackageManager.getApplicationLogo(ApplicationInfo)
public Drawable getManagedUserBadgedDrawable(Drawable drawable, Rect badgeLocation, int badgeDensity)
PackageManager
If the original drawable is a BitmapDrawable and the backing bitmap is
mutable as per Bitmap.isMutable()
, the badging
is performed in place and the original drawable is returned.
getManagedUserBadgedDrawable
in class PackageManager
drawable
- The drawable to badge.badgeLocation
- Where in the bounds of the badged drawable to place
the badge. If it's null
, the badge is applied on top of the entire
drawable being badged.badgeDensity
- The optional desired density for the badge as per
DisplayMetrics.densityDpi
. If it's not positive,
the density of the display is used.public Drawable getUserBadgedIcon(Drawable icon, UserHandle user)
PackageManager
PackageManager.getUserBadgedDrawableForDensity(
android.graphics.drawable.Drawable, UserHandle, android.graphics.Rect, int)
.
If the original drawable is a BitmapDrawable and the backing bitmap is
mutable as per Bitmap.isMutable()
, the badging
is performed in place and the original drawable is returned.
getUserBadgedIcon
in class PackageManager
icon
- The icon to badge.user
- The target user.public Drawable getUserBadgedDrawableForDensity(Drawable drawable, UserHandle user, Rect badgeLocation, int badgeDensity)
PackageManager
If the original drawable is a BitmapDrawable and the backing bitmap is
mutable as per Bitmap.isMutable()
, the badging
is performed in place and the original drawable is returned.
getUserBadgedDrawableForDensity
in class PackageManager
drawable
- The drawable to badge.user
- The target user.badgeLocation
- Where in the bounds of the badged drawable to place
the badge. If it's null
, the badge is applied on top of the entire
drawable being badged.badgeDensity
- The optional desired density for the badge as per
DisplayMetrics.densityDpi
. If it's not positive,
the density of the display is used.public Drawable getUserBadgeForDensity(UserHandle user, int density)
PackageManager
getUserBadgeForDensity
in class PackageManager
user
- The target user.density
- The optional desired density for the badge as per
DisplayMetrics.densityDpi
. If not provided
the density of the current display is used.public Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density)
PackageManager
getUserBadgeForDensityNoBackground
in class PackageManager
user
- The target user.density
- The optional desired density for the badge as per
DisplayMetrics.densityDpi
. If not provided
the density of the current display is used.public CharSequence getUserBadgedLabel(CharSequence label, UserHandle user)
PackageManager
getUserBadgedLabel
in class PackageManager
label
- The label to change.user
- The target user.public CharSequence getText(String packageName, int resid, ApplicationInfo appInfo)
PackageManager
ComponentInfo
to implement retrieval of their associated
labels and other text.getText
in class PackageManager
packageName
- The name of the package that this text is coming from.
Cannot be null.resid
- The resource identifier of the desired text. Cannot be 0.appInfo
- Overall information about packageName. This
may be null, in which case the application information will be retrieved
for you if needed; if you already have this information around, it can
be much more efficient to supply it here.public XmlResourceParser getXml(String packageName, int resid, ApplicationInfo appInfo)
PackageManager
getXml
in class PackageManager
packageName
- The name of the package that this xml is coming from.
Cannot be null.resid
- The resource identifier of the desired xml. Cannot be 0.appInfo
- Overall information about packageName. This
may be null, in which case the application information will be retrieved
for you if needed; if you already have this information around, it can
be much more efficient to supply it here.public CharSequence getApplicationLabel(ApplicationInfo info)
PackageManager
getApplicationLabel
in class PackageManager
info
- The application to get the label of.public Resources getResourcesForActivity(ComponentName activityName) throws PackageManager.NameNotFoundException
PackageManager
getResourcesForActivity
in class PackageManager
activityName
- Name of the activity whose resources are to be
retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
application could not be loaded.PackageManager.getResourcesForApplication(ApplicationInfo)
public Resources getResourcesForApplication(ApplicationInfo app)
PackageManager
getResourcesForApplication
in class PackageManager
app
- Information about the desired application.public Resources getResourcesForApplication(String appPackageName) throws PackageManager.NameNotFoundException
PackageManager
getResourcesForApplication
in class PackageManager
appPackageName
- Package name of the application whose resources
are to be retrieved.PackageManager.NameNotFoundException
- Thrown if the resources for the given
application could not be loaded.PackageManager.getResourcesForApplication(ApplicationInfo)
public Resources getResourcesForApplicationAsUser(String appPackageName, int userId)
getResourcesForApplicationAsUser
in class PackageManager
public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags)
PackageManager
getPackageArchiveInfo
in class PackageManager
archiveFilePath
- The path to the archive fileflags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public void installPackage(Uri packageURI, IPackageInstallObserver observer, int flags, String installerPackageName)
installPackage
in class PackageManager
public void setInstallerPackageName(String targetPackage, String installerPackageName)
PackageManager
setInstallerPackageName
in class PackageManager
targetPackage
- The installed package whose installer will be changed.installerPackageName
- The package name of the new installer. May be
null to clear the association.public String getInstallerPackageName(String packageName)
PackageManager
getInstallerPackageName
in class PackageManager
packageName
- The name of the package to querypublic int getMoveStatus(int moveId)
getMoveStatus
in class PackageManager
public void registerMoveCallback(PackageManager.MoveCallback callback, Handler handler)
registerMoveCallback
in class PackageManager
public void unregisterMoveCallback(PackageManager.MoveCallback callback)
unregisterMoveCallback
in class PackageManager
public int movePackage(String packageName, VolumeInfo vol)
movePackage
in class PackageManager
public VolumeInfo getPackageCurrentVolume(ApplicationInfo app)
getPackageCurrentVolume
in class PackageManager
public List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app)
getPackageCandidateVolumes
in class PackageManager
public int movePrimaryStorage(VolumeInfo vol)
movePrimaryStorage
in class PackageManager
public VolumeInfo getPrimaryStorageCurrentVolume()
getPrimaryStorageCurrentVolume
in class PackageManager
public List<VolumeInfo> getPrimaryStorageCandidateVolumes()
getPrimaryStorageCandidateVolumes
in class PackageManager
public void clearApplicationUserData(String packageName, IPackageDataObserver observer)
PackageManager
clearApplicationUserData
in class PackageManager
packageName
- The name of the packageobserver
- An observer callback to get notified when the operation is finished
android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)
will be called when that happens. observer may be null to indicate that
no callback is desired.public void deleteApplicationCacheFiles(String packageName, IPackageDataObserver observer)
PackageManager
android.Manifest.permission#DELETE_CACHE_FILES
permission, if the
named package cannot be found, or if the named package is a "system package".deleteApplicationCacheFiles
in class PackageManager
packageName
- The name of the package to deleteobserver
- An observer callback to get notified when the cache file deletion
is complete.
android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)
will be called when that happens. observer may be null to indicate that
no callback is desired.public void deleteApplicationCacheFilesAsUser(String packageName, int userId, IPackageDataObserver observer)
PackageManager
android.Manifest.permission#DELETE_CACHE_FILES
permission, if the named package
cannot be found, or if the named package is a "system package". If userId
does not
belong to the calling user, the caller must have
android.Manifest.permission#INTERACT_ACROSS_USERS
permission.deleteApplicationCacheFilesAsUser
in class PackageManager
packageName
- The name of the package to deleteuserId
- the user for which the cache files needs to be deletedobserver
- An observer callback to get notified when the cache file deletion is
complete.
android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)
will be called when that happens. observer may be null to indicate that no
callback is desired.public void freeStorageAndNotify(String volumeUuid, long idealStorageSize, IPackageDataObserver observer)
freeStorageAndNotify
in class PackageManager
public void freeStorage(String volumeUuid, long idealStorageSize, IntentSender pi)
freeStorage
in class PackageManager
public void deletePackage(String packageName, IPackageDeleteObserver observer, int flags)
PackageManager
android.Manifest.permission#DELETE_PACKAGES
permission, if the
named package cannot be found, or if the named package is a system
package.deletePackage
in class PackageManager
packageName
- The name of the package to deleteobserver
- An observer callback to get notified when the package
deletion is complete.
android.content.pm.IPackageDeleteObserver#packageDeleted
will be called when that happens. observer may be null to
indicate that no callback is desired.public void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, int flags, int userId)
PackageManager
deletePackageAsUser
in class PackageManager
packageName
- The name of the package to deleteobserver
- An observer callback to get notified when the package
deletion is complete.
android.content.pm.IPackageDeleteObserver#packageDeleted
will be called when that happens. observer may be null to
indicate that no callback is desired.userId
- The user Idpublic void addPackageToPreferred(String packageName)
addPackageToPreferred
in class PackageManager
public void removePackageFromPreferred(String packageName)
removePackageFromPreferred
in class PackageManager
public List<PackageInfo> getPreferredPackages(int flags)
PackageManager
getPreferredPackages
in class PackageManager
flags
- Additional option flags. Use any combination of
PackageManager.GET_ACTIVITIES
, PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
, PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
, PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
, PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
, PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
, PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
, PackageManager.GET_UNINSTALLED_PACKAGES
,
PackageManager.MATCH_DISABLED_COMPONENTS
, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
to modify the data returned.PackageManager.GET_ACTIVITIES
,
PackageManager.GET_CONFIGURATIONS
,
PackageManager.GET_GIDS
,
PackageManager.GET_INSTRUMENTATION
,
PackageManager.GET_INTENT_FILTERS
,
PackageManager.GET_META_DATA
,
PackageManager.GET_PERMISSIONS
,
PackageManager.GET_PROVIDERS
,
PackageManager.GET_RECEIVERS
,
PackageManager.GET_SERVICES
,
PackageManager.GET_SHARED_LIBRARY_FILES
,
PackageManager.GET_SIGNATURES
,
PackageManager.GET_URI_PERMISSION_PATTERNS
,
PackageManager.MATCH_DISABLED_COMPONENTS
,
PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
PackageManager.MATCH_UNINSTALLED_PACKAGES
public void setComponentEnabledSetting(ComponentName componentName, int newState, int flags)
PackageManager
setComponentEnabledSetting
in class PackageManager
componentName
- The component to enablenewState
- The new enabled state for the component. The legal values for this state
are:
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
and
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
The last one removes the setting, thereby restoring the component's state to
whatever was set in it's manifest (or enabled, by default).flags
- Optional behavior flags: PackageManager.DONT_KILL_APP
or 0.public int getComponentEnabledSetting(ComponentName componentName)
PackageManager
PackageManager.setComponentEnabledSetting(ComponentName, int, int)
; in most
cases this value will be PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
since
the value originally specified in the manifest has not been modified.getComponentEnabledSetting
in class PackageManager
componentName
- The component to retrieve.PackageManager.COMPONENT_ENABLED_STATE_ENABLED
,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
, or
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
. The last one means the
component's enabled state is based on the original information in
the manifest as found in ComponentInfo
.public void setApplicationEnabledSetting(String packageName, int newState, int flags)
PackageManager
PackageManager.setComponentEnabledSetting(android.content.ComponentName, int, int)
for any of the application's components.setApplicationEnabledSetting
in class PackageManager
packageName
- The package name of the application to enablenewState
- The new enabled state for the component. The legal values for this state
are:
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
and
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
The last one removes the setting, thereby restoring the applications's state to
whatever was set in its manifest (or enabled, by default).flags
- Optional behavior flags: PackageManager.DONT_KILL_APP
or 0.public int getApplicationEnabledSetting(String packageName)
PackageManager
PackageManager.setApplicationEnabledSetting(String, int, int)
; in most
cases this value will be PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
since
the value originally specified in the manifest has not been modified.getApplicationEnabledSetting
in class PackageManager
packageName
- The package name of the application to retrieve.PackageManager.COMPONENT_ENABLED_STATE_ENABLED
,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
, or
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
. The last one means the
application's enabled state is based on the original information in
the manifest as found in ApplicationInfo
.public void flushPackageRestrictionsAsUser(int userId)
PackageManager
flushPackageRestrictionsAsUser
in class PackageManager
userId
- Ther userId of the user whose restrictions are to be flushed.public void addPreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity)
addPreferredActivity
in class PackageManager
filter
- The set of intents under which this activity will be
made preferred.match
- The IntentFilter match category that this preference
applies to.set
- The set of activities that the user was picking from when
this preference was made.activity
- The component name of the activity that is to be
preferred.public void replacePreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity)
replacePreferredActivity
in class PackageManager
filter
- The set of intents under which this activity will be
made preferred.match
- The IntentFilter match category that this preference
applies to.set
- The set of activities that the user was picking from when
this preference was made.activity
- The component name of the activity that is to be
preferred.public void clearPackagePreferredActivities(String packageName)
PackageManager
PackageManager.addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName)
, from the
system whose activities are implemented in the given package name.
An application can only clear its own package(s).clearPackagePreferredActivities
in class PackageManager
packageName
- The name of the package whose preferred activity
mappings are to be removed.public void getPackageSizeInfoAsUser(String packageName, int userHandle, IPackageStatsObserver observer)
PackageManager
android.Manifest.permission#GET_PACKAGE_SIZE
permission.getPackageSizeInfoAsUser
in class PackageManager
packageName
- The name of the package whose size information is to be retrieveduserHandle
- The user whose size information should be retrieved.observer
- An observer callback to get notified when the operation
is complete.
android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)
The observer's callback is invoked with a PackageStats object(containing the
code, data and cache sizes of the package) and a boolean value representing
the status of the operation. observer may be null to indicate that
no callback is desired.public int getPreferredActivities(List<IntentFilter> outFilters, List<ComponentName> outActivities, String packageName)
PackageManager
PackageManager.addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName)
, that are
currently registered with the system.getPreferredActivities
in class PackageManager
outFilters
- A required list in which to place the filters of all of the
preferred activities.outActivities
- A required list in which to place the component names of
all of the preferred activities.packageName
- An optional package in which you would like to limit
the list. If null, all activities will be returned; if non-null, only
those activities in the given package are returned.public ComponentName getHomeActivities(List<ResolveInfo> outActivities)
PackageManager
getHomeActivities
in class PackageManager
public String[] getSystemSharedLibraryNames()
PackageManager
getSystemSharedLibraryNames
in class PackageManager
public String getServicesSystemSharedLibraryPackageName()
PackageManager
getServicesSystemSharedLibraryPackageName
in class PackageManager
public String getSharedSystemSharedLibraryPackageName()
PackageManager
getSharedSystemSharedLibraryPackageName
in class PackageManager
public FeatureInfo[] getSystemAvailableFeatures()
PackageManager
getSystemAvailableFeatures
in class PackageManager
public boolean hasSystemFeature(String name)
PackageManager
PackageManager.getSystemAvailableFeatures()
. This tests for the
presence of any version of the given feature name; use
PackageManager.hasSystemFeature(String, int)
to check for a minimum version.hasSystemFeature
in class PackageManager
public boolean hasSystemFeature(String name, int version)
PackageManager
PackageManager.getSystemAvailableFeatures()
. Since
features are defined to always be backwards compatible, this returns true
if the available feature version is greater than or equal to the
requested version.hasSystemFeature
in class PackageManager
public boolean isSafeMode()
PackageManager
isSafeMode
in class PackageManager
public KeySet getKeySetByAlias(String packageName, String alias)
PackageManager
KeySet
associated with the String alias for this
application.getKeySetByAlias
in class PackageManager
alias
- The alias for a given KeySet
as defined in the
application's AndroidManifest.xml.public KeySet getSigningKeySet(String packageName)
PackageManager
KeySet
for this application.getSigningKeySet
in class PackageManager
public boolean isSignedBy(String packageName, KeySet ks)
PackageManager
KeySet
ks. This will return true if
the package has been signed by additional keys (a superset) as well.
Compare to PackageManager.isSignedByExactly(String packageName, KeySet ks)
.isSignedBy
in class PackageManager
public boolean isSignedByExactly(String packageName, KeySet ks)
PackageManager
KeySet
ks. Compare to
PackageManager.isSignedBy(String packageName, KeySet ks)
.isSignedByExactly
in class PackageManager
public String[] setPackagesSuspendedAsUser(String[] packageNames, boolean hidden, int userId)
PackageManager
It doesn't remove the data or the actual package file. The application notifications will be hidden, the application will not show up in recents, will not be able to show toasts or dialogs or ring the device.
The package must already be installed. If the package is uninstalled while suspended the package will no longer be suspended.
setPackagesSuspendedAsUser
in class PackageManager
packageNames
- The names of the packages to set the suspended status.hidden
- If set to true
than the packages will be suspended, if set to
false
the packages will be unsuspended.userId
- The user id.public boolean isPackageSuspendedForUser(String packageName, int userId)
isPackageSuspendedForUser
in class PackageManager
packageName
- The name of the package to get the suspended status of.userId
- The user id.true
if the package is suspended or false
if the package is not
suspended or could not be found.#setPackageSuspendedAsUser(String, boolean, int)
public boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, UserHandle user)
PackageManager
PackageManager.installExistingPackage(String)
setApplicationHiddenSettingAsUser
in class PackageManager
public boolean getApplicationHiddenSettingAsUser(String packageName, UserHandle user)
PackageManager
getApplicationHiddenSettingAsUser
in class PackageManager
PackageManager.setApplicationHiddenSettingAsUser(String, boolean, UserHandle)
public int installExistingPackage(String packageName) throws PackageManager.NameNotFoundException
PackageManager
installExistingPackage
in class PackageManager
PackageManager.NameNotFoundException
public int installExistingPackageAsUser(String packageName, int userId) throws PackageManager.NameNotFoundException
PackageManager
installExistingPackageAsUser
in class PackageManager
PackageManager.NameNotFoundException
public void verifyPendingInstall(int id, int verificationCode)
PackageManager
package verification
broadcast
to respond to the package manager. The response must include
the verificationCode
which is one of
PackageManager.VERIFICATION_ALLOW
or
PackageManager.VERIFICATION_REJECT
.verifyPendingInstall
in class PackageManager
id
- pending package identifier as passed via the
PackageManager.EXTRA_VERIFICATION_ID
Intent extra.verificationCode
- either PackageManager.VERIFICATION_ALLOW
or PackageManager.VERIFICATION_REJECT
.public void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)
PackageManager
package verification
broadcast
to extend the default timeout for a response and declare what
action to perform after the timeout occurs. The response must include
the verificationCodeAtTimeout
which is one of
PackageManager.VERIFICATION_ALLOW
or
PackageManager.VERIFICATION_REJECT
.
This method may only be called once per package id. Additional calls
will have no effect.extendVerificationTimeout
in class PackageManager
id
- pending package identifier as passed via the
PackageManager.EXTRA_VERIFICATION_ID
Intent extra.verificationCodeAtTimeout
- either
PackageManager.VERIFICATION_ALLOW
or
PackageManager.VERIFICATION_REJECT
. If
verificationCodeAtTimeout
is neither
PackageManager.VERIFICATION_ALLOW
or
PackageManager.VERIFICATION_REJECT
, then
verificationCodeAtTimeout
will default to
PackageManager.VERIFICATION_REJECT
.millisecondsToDelay
- the amount of time requested for the timeout.
Must be positive and less than
PackageManager.MAXIMUM_VERIFICATION_TIMEOUT
. If
millisecondsToDelay
is out of bounds,
millisecondsToDelay
will be set to the closest in
bounds value; namely, 0 or
PackageManager.MAXIMUM_VERIFICATION_TIMEOUT
.public void verifyIntentFilter(int id, int verificationCode, List<String> outFailedDomains)
PackageManager
Intent.ACTION_INTENT_FILTER_NEEDS_VERIFICATION
intent filter verification
broadcast to respond to the package manager. The response must include
the verificationCode
which is one of
PackageManager.INTENT_FILTER_VERIFICATION_SUCCESS
or
PackageManager.INTENT_FILTER_VERIFICATION_FAILURE
.verifyIntentFilter
in class PackageManager
id
- pending package identifier as passed via the
PackageManager.EXTRA_VERIFICATION_ID
Intent extra.verificationCode
- either PackageManager.INTENT_FILTER_VERIFICATION_SUCCESS
or PackageManager.INTENT_FILTER_VERIFICATION_FAILURE
.outFailedDomains
- a list of failed domains if the verificationCode is
PackageManager.INTENT_FILTER_VERIFICATION_FAILURE
, otherwise null;public int getIntentVerificationStatusAsUser(String packageName, int userId)
PackageManager
IntentFilter.setAutoVerify(boolean)
and
IntentFilter.getAutoVerify()
This is used by the ResolverActivity to change the status depending on what the User select
in the Disambiguation Dialog and also used by the Settings App for changing the default App
for a domain.getIntentVerificationStatusAsUser
in class PackageManager
packageName
- The package name of the Activity associated with the IntentFilter.userId
- The user id.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK
or
PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS
or
PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER
or
PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED
public boolean updateIntentVerificationStatusAsUser(String packageName, int status, int userId)
PackageManager
IntentFilter.setAutoVerify(boolean)
and
IntentFilter.getAutoVerify()
This is used by the ResolverActivity to change the status depending on what the User select
in the Disambiguation Dialog and also used by the Settings App for changing the default App
for a domain.updateIntentVerificationStatusAsUser
in class PackageManager
packageName
- The package name of the Activity associated with the IntentFilter.status
- The status to set to. This can be
PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK
or
PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS
or
PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER
userId
- The user id.public List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName)
PackageManager
getIntentFilterVerifications
in class PackageManager
packageName
- the package name. When this parameter is set to a non null value,
the results will be filtered by the package name provided.
Otherwise, there will be no filtering and it will return a list
corresponding for all packagespublic List<IntentFilter> getAllIntentFilters(String packageName)
PackageManager
getAllIntentFilters
in class PackageManager
packageName
- the package name. This parameter is set to a non null value,
the list will contain all the IntentFilter for that package.
Otherwise, the list will be empty.@Deprecated public String getDefaultBrowserPackageName(int userId)
public String getDefaultBrowserPackageNameAsUser(int userId)
getDefaultBrowserPackageNameAsUser
in class PackageManager
userId
- The user id.@Deprecated public boolean setDefaultBrowserPackageName(String packageName, int userId)
public boolean setDefaultBrowserPackageNameAsUser(String packageName, int userId)
setDefaultBrowserPackageNameAsUser
in class PackageManager
packageName
- The package name of the default Browser.userId
- The user id.public VerifierDeviceIdentity getVerifierDeviceIdentity()
PackageManager
getVerifierDeviceIdentity
in class PackageManager
public boolean isUpgrade()
PackageManager
isUpgrade
in class PackageManager
public void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, int targetUserId, int flags)
PackageManager
CrossProfileIntentFilter
. After calling this method all
intents sent from the user with id sourceUserId can also be be resolved
by activities in the user with id targetUserId if they match the
specified intent filter.addCrossProfileIntentFilter
in class PackageManager
filter
- The IntentFilter
the intent has to matchsourceUserId
- The source user id.targetUserId
- The target user id.flags
- The possible values are PackageManager.SKIP_CURRENT_PROFILE
and
PackageManager.ONLY_IF_NO_MATCH_FOUND
.public void clearCrossProfileIntentFilters(int sourceUserId)
PackageManager
CrossProfileIntentFilter
s which have the specified user
as their source, and have been set by the app calling this method.clearCrossProfileIntentFilters
in class PackageManager
sourceUserId
- The source user id.public PackageInstaller getPackageInstaller()
getPackageInstaller
in class PackageManager
public boolean isPackageAvailable(String packageName)
isPackageAvailable
in class PackageManager
public Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo)
loadItemIcon
in class PackageManager
public Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo)
loadUnbadgedItemIcon
in class PackageManager