public abstract class PackageManager extends Object
Context.getPackageManager()
.Modifier and Type | Field and Description |
---|---|
static String |
ACTION_CLEAN_EXTERNAL_STORAGE
Action to external storage service to clean out removed apps.
|
static String |
ACTION_REQUEST_PERMISSIONS
The action used to request that the user approve a permission request
from the application.
|
static boolean |
APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE |
static int |
COMPONENT_ENABLED_STATE_DEFAULT
Flag for
setApplicationEnabledSetting(String, int, int)
and setComponentEnabledSetting(ComponentName, int, int) : This
component or application is in its default enabled state (as specified
in its manifest). |
static int |
COMPONENT_ENABLED_STATE_DISABLED
Flag for
setApplicationEnabledSetting(String, int, int)
and setComponentEnabledSetting(ComponentName, int, int) : This
component or application has been explicitly disabled, regardless of
what it has specified in its manifest. |
static int |
COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
Flag for
setApplicationEnabledSetting(String, int, int) only: This
application should be considered, until the point where the user actually
wants to use it. |
static int |
COMPONENT_ENABLED_STATE_DISABLED_USER
Flag for
setApplicationEnabledSetting(String, int, int) only: The
user has explicitly disabled the application, regardless of what it has
specified in its manifest. |
static int |
COMPONENT_ENABLED_STATE_ENABLED
Flag for
setApplicationEnabledSetting(String, int, int)
and setComponentEnabledSetting(ComponentName, int, int) : This
component or application has been explictily enabled, regardless of
what it has specified in its manifest. |
static int |
DELETE_ALL_USERS
Flag parameter for
deletePackage(java.lang.String, IPackageDeleteObserver, int) to indicate that you want the
package deleted for all users. |
static int |
DELETE_DONT_KILL_APP
Flag parameter for
deletePackage(java.lang.String, IPackageDeleteObserver, int) to indicate that, if you are calling
uninstall on a package that is replaced to provide new feature splits, the
existing application should not be killed during the removal process. |
static int |
DELETE_FAILED_ABORTED |
static int |
DELETE_FAILED_DEVICE_POLICY_MANAGER
Deletion failed return code: this is passed to the
IPackageDeleteObserver if the system failed to delete the package
because it is the active DevicePolicy manager. |
static int |
DELETE_FAILED_INTERNAL_ERROR
Deletion failed return code: this is passed to the
IPackageDeleteObserver if the system failed to delete the package
for an unspecified reason. |
static int |
DELETE_FAILED_OWNER_BLOCKED
Deletion failed return code: this is passed to the
IPackageDeleteObserver if the system failed to delete the package
because a profile or device owner has marked the package as
uninstallable. |
static int |
DELETE_FAILED_USER_RESTRICTED
Deletion failed return code: this is passed to the
IPackageDeleteObserver if the system failed to delete the package
since the user is restricted. |
static int |
DELETE_KEEP_DATA
Flag parameter for
deletePackage(java.lang.String, IPackageDeleteObserver, int) to indicate that you don't want to delete the
package's data directory. |
static int |
DELETE_SUCCEEDED
Return code for when package deletion succeeds.
|
static int |
DELETE_SYSTEM_APP
Flag parameter for
deletePackage(java.lang.String, IPackageDeleteObserver, int) to indicate that, if you are calling
uninstall on a system that has been updated, then don't do the normal process
of uninstalling the update and rolling back to the older system version (which
needs to happen for all users); instead, just mark the app as uninstalled for
the current user. |
static int |
DONT_KILL_APP
Flag parameter for
setComponentEnabledSetting(android.content.ComponentName, int, int) to indicate
that you don't want to kill the app containing the component. |
static String |
EXTRA_FAILURE_EXISTING_PACKAGE
String extra for
PackageInstallObserver in the 'extras' Bundle in case of
INSTALL_FAILED_DUPLICATE_PERMISSION . |
static String |
EXTRA_FAILURE_EXISTING_PERMISSION
String extra for
PackageInstallObserver in the 'extras' Bundle in case of
INSTALL_FAILED_DUPLICATE_PERMISSION . |
static String |
EXTRA_INTENT_FILTER_VERIFICATION_HOSTS
Extra field name for the host names to be used for an intent filter pending verification.
|
static String |
EXTRA_INTENT_FILTER_VERIFICATION_ID
Extra field name for the ID of a intent filter pending verification.
|
static String |
EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME
Extra field name for the package name to be used for an intent filter pending verification.
|
static String |
EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME
Extra field name for the scheme used for an intent filter pending verification.
|
static String |
EXTRA_MOVE_ID |
static String |
EXTRA_REQUEST_PERMISSIONS_NAMES
The names of the requested permissions.
|
static String |
EXTRA_REQUEST_PERMISSIONS_RESULTS
The results from the permissions request.
|
static String |
EXTRA_VERIFICATION_ID
Extra field name for the ID of a package pending verification.
|
static String |
EXTRA_VERIFICATION_INSTALL_FLAGS
Extra field name for the requested install flags for a package pending
verification.
|
static String |
EXTRA_VERIFICATION_INSTALLER_PACKAGE
Extra field name for the package identifier which is trying to install
the package.
|
static String |
EXTRA_VERIFICATION_INSTALLER_UID
Extra field name for the uid of who is requesting to install
the package.
|
static String |
EXTRA_VERIFICATION_PACKAGE_NAME
Extra field name for the package name of a package pending verification.
|
static String |
EXTRA_VERIFICATION_RESULT
Extra field name for the result of a verification, either
VERIFICATION_ALLOW , or VERIFICATION_REJECT . |
static String |
EXTRA_VERIFICATION_URI
Extra field name for the URI to a verification file.
|
static String |
EXTRA_VERIFICATION_VERSION_CODE
Extra field name for the version code of a package pending verification.
|
static String |
FEATURE_APP_WIDGETS
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports app widgets. |
static String |
FEATURE_AUDIO_LOW_LATENCY
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) : The device's
audio pipeline is low-latency, more suitable for audio applications sensitive to delays or
lag in sound input or output. |
static String |
FEATURE_AUDIO_OUTPUT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes at least one form of audio
output, such as speakers, audio jack or streaming over bluetooth |
static String |
FEATURE_AUDIO_PRO
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device has professional audio level of functionality and performance. |
static String |
FEATURE_AUTOMOTIVE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : This is a device dedicated to showing UI
on a vehicle headunit. |
static String |
FEATURE_BACKUP
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device can perform backup and restore operations on installed applications. |
static String |
FEATURE_BLUETOOTH
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device is capable of communicating with
other devices via Bluetooth. |
static String |
FEATURE_BLUETOOTH_LE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device is capable of communicating with
other devices via Bluetooth Low Energy radio. |
static String |
FEATURE_CAMERA
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has a camera facing away
from the screen. |
static String |
FEATURE_CAMERA_ANY
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has at least one camera pointing in
some direction, or can support an external camera being connected to it. |
static String |
FEATURE_CAMERA_AUTOFOCUS
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device's camera supports auto-focus. |
static String |
FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) : At least one
of the cameras on the device supports the
manual post-processing
capability level. |
static String |
FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) : At least one
of the cameras on the device supports the
manual sensor
capability level. |
static String |
FEATURE_CAMERA_CAPABILITY_RAW
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) : At least one
of the cameras on the device supports the
RAW
capability level. |
static String |
FEATURE_CAMERA_EXTERNAL
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device can support having an external camera connected to it. |
static String |
FEATURE_CAMERA_FLASH
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device's camera supports flash. |
static String |
FEATURE_CAMERA_FRONT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has a front facing camera. |
static String |
FEATURE_CAMERA_LEVEL_FULL
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) : At least one
of the cameras on the device supports the
full hardware
capability level. |
static String |
FEATURE_CONNECTION_SERVICE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The Connection Service API is enabled on the device. |
static String |
FEATURE_CONSUMER_IR
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device is capable of communicating with
consumer IR devices. |
static String |
FEATURE_DEVICE_ADMIN
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports device policy enforcement via device admins. |
static String |
FEATURE_ETHERNET
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : This device supports ethernet. |
static String |
FEATURE_FAKETOUCH
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device does not have a touch screen, but
does support touch emulation for basic events. |
static String |
FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device does not have a touch screen, but
does support touch emulation for basic events that supports distinct
tracking of two or more fingers. |
static String |
FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device does not have a touch screen, but
does support touch emulation for basic events that supports tracking
a hand of fingers (5 or more fingers) fully independently. |
static String |
FEATURE_FILE_BASED_ENCRYPTION |
static String |
FEATURE_FINGERPRINT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has biometric hardware to detect a fingerprint. |
static String |
FEATURE_FREEFORM_WINDOW_MANAGEMENT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports freeform window management. |
static String |
FEATURE_GAMEPAD
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device has all of the inputs necessary to be considered a compatible game controller, or
includes a compatible game controller in the box. |
static String |
FEATURE_HDMI_CEC
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : This device supports HDMI-CEC. |
static String |
FEATURE_HIFI_SENSORS
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports high fidelity sensor processing
capabilities. |
static String |
FEATURE_HOME_SCREEN
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports a home screen that is replaceable
by third party applications. |
static String |
FEATURE_INPUT_METHODS
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports adding new input methods implemented
with the InputMethodService API. |
static String |
FEATURE_LEANBACK
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports leanback UI. |
static String |
FEATURE_LEANBACK_ONLY
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports only leanback UI. |
static String |
FEATURE_LIVE_TV
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports live TV and can display
contents from TV inputs implemented with the
TvInputService API. |
static String |
FEATURE_LIVE_WALLPAPER
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports live wallpapers. |
static String |
FEATURE_LOCATION
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports one or more methods of
reporting current location. |
static String |
FEATURE_LOCATION_GPS
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has a Global Positioning System
receiver and can report precise location. |
static String |
FEATURE_LOCATION_NETWORK
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device can report location with coarse
accuracy using a network-based geolocation system. |
static String |
FEATURE_MANAGED_PROFILES |
static String |
FEATURE_MANAGED_USERS
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device supports creating secondary users and managed profiles via
DevicePolicyManager . |
static String |
FEATURE_MICROPHONE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device can record audio via a
microphone. |
static String |
FEATURE_MIDI
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device has a full implementation of the android.media.midi.* APIs. |
static String |
FEATURE_NFC
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device can communicate using Near-Field
Communications (NFC). |
static String |
FEATURE_NFC_HCE
Deprecated.
|
static String |
FEATURE_NFC_HOST_CARD_EMULATION
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports host-
based NFC card emulation. |
static String |
FEATURE_NFC_HOST_CARD_EMULATION_NFCF
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports host-
based NFC-F card emulation. |
static String |
FEATURE_OPENGLES_EXTENSION_PACK
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports the OpenGL ES
Android Extension Pack. |
static String |
FEATURE_PICTURE_IN_PICTURE
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device supports picture-in-picture multi-window mode. |
static String |
FEATURE_PRINTING
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device supports printing. |
static String |
FEATURE_SCREEN_LANDSCAPE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports landscape orientation
screens. |
static String |
FEATURE_SCREEN_PORTRAIT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports portrait orientation
screens. |
static String |
FEATURE_SECURELY_REMOVES_USERS
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device supports secure removal of users. |
static String |
FEATURE_SENSOR_ACCELEROMETER
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes an accelerometer. |
static String |
FEATURE_SENSOR_AMBIENT_TEMPERATURE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes an ambient temperature sensor. |
static String |
FEATURE_SENSOR_BAROMETER
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a barometer (air
pressure sensor.) |
static String |
FEATURE_SENSOR_COMPASS
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a magnetometer (compass). |
static String |
FEATURE_SENSOR_GYROSCOPE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a gyroscope. |
static String |
FEATURE_SENSOR_HEART_RATE
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a heart rate monitor. |
static String |
FEATURE_SENSOR_HEART_RATE_ECG
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The heart rate sensor on this device is an Electrocardiogram. |
static String |
FEATURE_SENSOR_LIGHT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a light sensor. |
static String |
FEATURE_SENSOR_PROXIMITY
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a proximity sensor. |
static String |
FEATURE_SENSOR_RELATIVE_HUMIDITY
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a relative humidity sensor. |
static String |
FEATURE_SENSOR_STEP_COUNTER
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a hardware step counter. |
static String |
FEATURE_SENSOR_STEP_DETECTOR
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device includes a hardware step detector. |
static String |
FEATURE_SIP
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The SIP API is enabled on the device. |
static String |
FEATURE_SIP_VOIP
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports SIP-based VOIP. |
static String |
FEATURE_TELEPHONY
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has a telephony radio with data
communication support. |
static String |
FEATURE_TELEPHONY_CDMA
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has a CDMA telephony stack. |
static String |
FEATURE_TELEPHONY_GSM
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device has a GSM telephony stack. |
static String |
FEATURE_TELEVISION
Deprecated.
use
FEATURE_LEANBACK instead. |
static String |
FEATURE_TOUCHSCREEN
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device's display has a touch screen. |
static String |
FEATURE_TOUCHSCREEN_MULTITOUCH
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device's touch screen supports
multitouch sufficient for basic two-finger gesture detection. |
static String |
FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device's touch screen is capable of
tracking two or more fingers fully independently. |
static String |
FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device's touch screen is capable of
tracking a full hand of fingers fully independently -- that is, 5 or
more simultaneous independent pointers. |
static String |
FEATURE_USB_ACCESSORY
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports connecting to USB accessories. |
static String |
FEATURE_USB_HOST
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports connecting to USB devices
as the USB host. |
static String |
FEATURE_VERIFIED_BOOT
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device supports verified boot. |
static String |
FEATURE_VOICE_RECOGNIZERS |
static String |
FEATURE_VR_MODE
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device implements an optimized mode for virtual reality (VR) applications that handles
stereoscopic rendering of notifications, and disables most monocular system UI components
while a VR application has user focus. |
static String |
FEATURE_VR_MODE_HIGH_PERFORMANCE
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device implements FEATURE_VR_MODE but additionally meets extra CDD requirements
to provide a high-quality VR experience. |
static String |
FEATURE_VULKAN_HARDWARE_LEVEL
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(String, int) : If this feature is supported, the Vulkan native API
will enumerate at least one VkPhysicalDevice , and the feature version will indicate
what level of optional hardware features limits it supports. |
static String |
FEATURE_VULKAN_HARDWARE_VERSION
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(String, int) : The version of this feature indicates the highest
VkPhysicalDeviceProperties::apiVersion supported by the physical devices that support
the hardware level indicated by FEATURE_VULKAN_HARDWARE_LEVEL . |
static String |
FEATURE_WATCH
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : This is a device dedicated to showing UI
on a watch. |
static String |
FEATURE_WEBVIEW
Feature for
getSystemAvailableFeatures() and hasSystemFeature(java.lang.String) :
The device has a full implementation of the android.webkit.* APIs. |
static String |
FEATURE_WIFI
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports WiFi (802.11) networking. |
static String |
FEATURE_WIFI_DIRECT
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports Wi-Fi Direct networking. |
static String |
FEATURE_WIFI_NAN
Feature for
getSystemAvailableFeatures() and
hasSystemFeature(java.lang.String) : The device supports Wi-Fi Aware (NAN)
networking. |
static int |
FLAG_PERMISSION_GRANTED_BY_DEFAULT
Permission flag: The permission is granted by default because it
enables app functionality that is expected to work out-of-the-box
for providing a smooth user experience.
|
static int |
FLAG_PERMISSION_POLICY_FIXED
Permission flag: The permission is set in its current state
by device policy and neither apps nor the user can change
its state.
|
static int |
FLAG_PERMISSION_REVIEW_REQUIRED
Permission flag: The permission has to be reviewed before any of
the app components can run.
|
static int |
FLAG_PERMISSION_REVOKE_ON_UPGRADE
Permission flag: The permission is set in a granted state but
access to resources it guards is restricted by other means to
enable revoking a permission on legacy apps that do not support
runtime permissions.
|
static int |
FLAG_PERMISSION_SYSTEM_FIXED
Permission flag: The permission is set in its current state
because the app is a component that is a part of the system.
|
static int |
FLAG_PERMISSION_USER_FIXED
Permission flag: The permission is set in its current state
by the user and it is fixed, i.e. apps can no longer request
this permission.
|
static int |
FLAG_PERMISSION_USER_SET
Permission flag: The permission is set in its current state
by the user and apps can still request it at runtime.
|
static int |
GET_ACTIVITIES
PackageInfo flag: return information about
activities in the package in PackageInfo.activities . |
static int |
GET_CONFIGURATIONS
PackageInfo flag: return information about
hardware preferences in
PackageInfo.configPreferences ,
and requested features in PackageInfo.reqFeatures and
PackageInfo.featureGroups . |
static int |
GET_DISABLED_COMPONENTS
Deprecated.
replaced with
MATCH_DISABLED_COMPONENTS |
static int |
GET_DISABLED_UNTIL_USED_COMPONENTS
Deprecated.
replaced with
MATCH_DISABLED_UNTIL_USED_COMPONENTS . |
static int |
GET_GIDS
PackageInfo flag: return the
group ids that are associated with an
application. |
static int |
GET_INSTRUMENTATION
PackageInfo flag: return information about
instrumentation in the package in
PackageInfo.instrumentation . |
static int |
GET_INTENT_FILTERS
PackageInfo flag: return information about the
intent filters supported by the activity. |
static int |
GET_META_DATA
ComponentInfo flag: return the PackageItemInfo.metaData
data Bundle s that are associated with a component. |
static int |
GET_PERMISSIONS
PackageInfo flag: return information about
permissions in the package in
PackageInfo.permissions . |
static int |
GET_PROVIDERS
PackageInfo flag: return information about
content providers in the package in
PackageInfo.providers . |
static int |
GET_RECEIVERS
PackageInfo flag: return information about
intent receivers in the package in
PackageInfo.receivers . |
static int |
GET_RESOLVED_FILTER
ResolveInfo flag: return the IntentFilter that
was matched for a particular ResolveInfo in
ResolveInfo.filter . |
static int |
GET_SERVICES
PackageInfo flag: return information about
services in the package in PackageInfo.services . |
static int |
GET_SHARED_LIBRARY_FILES
ApplicationInfo flag: return the
paths to the shared libraries
that are associated with an application. |
static int |
GET_SIGNATURES
PackageInfo flag: return information about the
signatures included in the package. |
static int |
GET_UNINSTALLED_PACKAGES
Deprecated.
replaced with
MATCH_UNINSTALLED_PACKAGES |
static int |
GET_URI_PERMISSION_PATTERNS
ProviderInfo flag: return the
URI permission patterns
that are associated with a content provider. |
static int |
INSTALL_ALL_USERS
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this install
should immediately be visible to all users. |
static int |
INSTALL_ALLOW_DOWNGRADE
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that it is okay
to install an update to an app where the newly installed app has a lower
version code than the currently installed app. |
static int |
INSTALL_ALLOW_TEST
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that you want to
allow test packages (those that have set android:testOnly in their
manifest) to be installed. |
static int |
INSTALL_DONT_KILL_APP
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this package contains
a feature split to an existing application and the existing application should not
be killed during the installation process. |
static int |
INSTALL_EPHEMERAL
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this package is
to be installed as a lightweight "ephemeral" app. |
static int |
INSTALL_EXTERNAL
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this package
must be installed to an ASEC on a VolumeInfo.TYPE_PUBLIC . |
static int |
INSTALL_FAILED_ABORTED |
static int |
INSTALL_FAILED_ALREADY_EXISTS
Installation return code: this is passed to the
IPackageInstallObserver if the package is already installed. |
static int |
INSTALL_FAILED_CONFLICTING_PROVIDER
Installation return code: this is passed to the
IPackageInstallObserver if the new package failed because it
contains a content provider with the same authority as a provider already
installed in the system. |
static int |
INSTALL_FAILED_CONTAINER_ERROR
Installation return code: this is passed to the
IPackageInstallObserver if a secure container mount point
couldn't be accessed on external media. |
static int |
INSTALL_FAILED_CPU_ABI_INCOMPATIBLE
Installation return code: this is passed to the
IPackageInstallObserver if the package being installed contains
native code, but none that is compatible with the device's CPU_ABI. |
static int |
INSTALL_FAILED_DEXOPT
Installation return code: this is passed to the
IPackageInstallObserver if the new package failed while
optimizing and validating its dex files, either because there was not
enough storage or the validation failed. |
static int |
INSTALL_FAILED_DUPLICATE_PACKAGE
Installation return code: this is passed to the
IPackageInstallObserver if a package is already installed with
the same name. |
static int |
INSTALL_FAILED_DUPLICATE_PERMISSION
Installation failed return code: this is passed to the
IPackageInstallObserver if the system failed to install the
package because it is attempting to define a permission that is already
defined by some existing package. |
static int |
INSTALL_FAILED_EPHEMERAL_INVALID
Installation failed return code: ephemeral app installs are incompatible with some
other installation flags supplied for the operation; or other circumstances such
as trying to upgrade a system app via an ephemeral install.
|
static int |
INSTALL_FAILED_INSUFFICIENT_STORAGE
Installation return code: this is passed to the
IPackageInstallObserver if the package manager service found that
the device didn't have enough storage space to install the app. |
static int |
INSTALL_FAILED_INTERNAL_ERROR
Installation failed return code: this is passed to the
IPackageInstallObserver if the system failed to install the
package because of system issues. |
static int |
INSTALL_FAILED_INVALID_APK
Installation return code: this is passed to the
IPackageInstallObserver if the package archive file is invalid. |
static int |
INSTALL_FAILED_INVALID_INSTALL_LOCATION
Installation return code: this is passed to the
IPackageInstallObserver if the new package couldn't be installed
in the specified install location. |
static int |
INSTALL_FAILED_INVALID_URI
Installation return code: this is passed to the
IPackageInstallObserver if the URI passed in is invalid. |
static int |
INSTALL_FAILED_MEDIA_UNAVAILABLE
Installation return code: this is passed to the
IPackageInstallObserver if the new package couldn't be installed
in the specified install location because the media is not available. |
static int |
INSTALL_FAILED_MISSING_FEATURE
Installation return code: this is passed to the
IPackageInstallObserver if the new package uses a feature that is
not available. |
static int |
INSTALL_FAILED_MISSING_SHARED_LIBRARY
Installation return code: this is passed to the
IPackageInstallObserver if the new package uses a shared library
that is not available. |
static int |
INSTALL_FAILED_NEWER_SDK
Installation return code: this is passed to the
IPackageInstallObserver if the new package failed because the
current SDK version is newer than that required by the package. |
static int |
INSTALL_FAILED_NO_MATCHING_ABIS
Installation failed return code: this is passed to the
IPackageInstallObserver if the system failed to install the
package because its packaged native code did not match any of the ABIs
supported by the system. |
static int |
INSTALL_FAILED_NO_SHARED_USER
Installation return code: this is passed to the
IPackageInstallObserver if the requested shared user does not
exist. |
static int |
INSTALL_FAILED_OLDER_SDK
Installation return code: this is passed to the
IPackageInstallObserver if the new package failed because the
current SDK version is older than that required by the package. |
static int |
INSTALL_FAILED_PACKAGE_CHANGED
Installation return code: this is passed to the
IPackageInstallObserver if the package changed from what the
calling program expected. |
static int |
INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE
Installation return code: this is passed to the
IPackageInstallObserver if the old package has target SDK high
enough to support runtime permission and the new package has target SDK
low enough to not support runtime permissions. |
static int |
INSTALL_FAILED_REPLACE_COULDNT_DELETE
Installation return code: this is passed to the
IPackageInstallObserver if the new package uses a shared library
that is not available. |
static int |
INSTALL_FAILED_SHARED_USER_INCOMPATIBLE
Installation return code: this is passed to the
IPackageInstallObserver if the new package is requested a shared
user which is already installed on the device and does not have matching
signature. |
static int |
INSTALL_FAILED_TEST_ONLY
Installation return code: this is passed to the
IPackageInstallObserver if the new package failed because it has
specified that it is a test-only package and the caller has not supplied
the INSTALL_ALLOW_TEST flag. |
static int |
INSTALL_FAILED_UID_CHANGED
Installation return code: this is passed to the
IPackageInstallObserver if the new package is assigned a
different UID than it previously held. |
static int |
INSTALL_FAILED_UPDATE_INCOMPATIBLE
Installation return code: this is passed to the
IPackageInstallObserver if a previously installed package of the
same name has a different signature than the new package (and the old
package's data was not removed). |
static int |
INSTALL_FAILED_USER_RESTRICTED
Installation failed return code: this is passed to the
IPackageInstallObserver if the system failed to install the
package because the user is restricted from installing apps. |
static int |
INSTALL_FAILED_VERIFICATION_FAILURE
Installation return code: this is passed to the
IPackageInstallObserver if the new package couldn't be installed
because the verification did not succeed. |
static int |
INSTALL_FAILED_VERIFICATION_TIMEOUT
Installation return code: this is passed to the
IPackageInstallObserver if the new package couldn't be installed
because the verification timed out. |
static int |
INSTALL_FAILED_VERSION_DOWNGRADE
Installation return code: this is passed to the
IPackageInstallObserver if the new package has an older version
code than the currently installed package. |
static int |
INSTALL_FORCE_PERMISSION_PROMPT
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that we always want to force
the prompt for permission approval. |
static int |
INSTALL_FORCE_SDK
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this package is an
upgrade to a package that refers to the SDK via release letter. |
static int |
INSTALL_FORCE_VOLUME_UUID |
static int |
INSTALL_FORWARD_LOCK
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this package
should be installed as forward locked, i.e. only the app itself should
have access to its code and non-resource assets. |
static int |
INSTALL_FROM_ADB
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this install
was initiated via ADB. |
static int |
INSTALL_GRANT_RUNTIME_PERMISSIONS
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that all runtime
permissions should be granted to the package. |
static int |
INSTALL_INTERNAL
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that this package
must be installed to internal storage. |
static int |
INSTALL_PARSE_FAILED_BAD_MANIFEST
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser was unable to retrieve the
AndroidManifest.xml file. |
static int |
INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser encountered a bad or
missing package name in the manifest. |
static int |
INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser encountered a bad shared
user id name in the manifest. |
static int |
INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser encountered a
CertificateEncodingException in one of the files in the .apk. |
static int |
INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser found inconsistent
certificates on the files in the .apk. |
static int |
INSTALL_PARSE_FAILED_MANIFEST_EMPTY
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser did not find any actionable
tags (instrumentation or application) in the manifest. |
static int |
INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser encountered some structural
problem in the manifest. |
static int |
INSTALL_PARSE_FAILED_NO_CERTIFICATES
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser did not find any
certificates in the .apk. |
static int |
INSTALL_PARSE_FAILED_NOT_APK
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser was given a path that is
not a file, or does not end with the expected '.apk' extension. |
static int |
INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
Installation parse return code: this is passed to the
IPackageInstallObserver if the parser encountered an unexpected
exception. |
static int |
INSTALL_REPLACE_EXISTING
Flag parameter for
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String) to indicate that you want to
replace an already installed package, if one exists. |
static int |
INSTALL_SUCCEEDED
Installation return code: this is passed to the
IPackageInstallObserver on success. |
static int |
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS
Used as the
status argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int) to indicate that the User
will never be prompted the Intent Disambiguation Dialog if there are two
or more resolution of the Intent. |
static int |
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK
Used as the
status argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int) to indicate that this app
should always be considered as an ambiguous candidate for handling the
matching Intent even if there are other candidate apps in the "always"
state. |
static int |
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK
Used as the
status argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int) to indicate that the User
will always be prompted the Intent Disambiguation Dialog if there are two
or more Intent resolved for the IntentFilter's domain(s). |
static int |
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER
Used as the
status argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int) to indicate that the User
may be prompted the Intent Disambiguation Dialog if there are two or more
Intent resolved. |
static int |
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED
Internal status code to indicate that an IntentFilter verification result is not specified.
|
static int |
INTENT_FILTER_VERIFICATION_FAILURE
Used as the
verificationCode argument for
verifyIntentFilter(int, int, java.util.List<java.lang.String>) to indicate that the calling
IntentFilter Verifier confirms that the IntentFilter is NOT verified. |
static int |
INTENT_FILTER_VERIFICATION_SUCCESS
Used as the
verificationCode argument for
verifyIntentFilter(int, int, java.util.List<java.lang.String>) to indicate that the calling
IntentFilter Verifier confirms that the IntentFilter is verified. |
static int |
MASK_PERMISSION_FLAGS
Mask for all permission flags.
|
static int |
MATCH_ALL
Querying flag: if set and if the platform is doing any filtering of the
results, then the filtering will not happen.
|
static int |
MATCH_DEBUG_TRIAGED_MISSING
Internal flag used to indicate that a system component has done their
homework and verified that they correctly handle packages and components
that come and go over time.
|
static int |
MATCH_DEFAULT_ONLY
Resolution and querying flag: if set, only filters that support the
Intent.CATEGORY_DEFAULT will be considered for
matching. |
static int |
MATCH_DIRECT_BOOT_AWARE
Querying flag: match components which are direct boot aware in
the returned info, regardless of the current user state.
|
static int |
MATCH_DIRECT_BOOT_UNAWARE
Querying flag: match components which are direct boot unaware in
the returned info, regardless of the current user state.
|
static int |
MATCH_DISABLED_COMPONENTS
PackageInfo flag: include disabled components in the returned info. |
static int |
MATCH_DISABLED_UNTIL_USED_COMPONENTS
PackageInfo flag: include disabled components which are in
that state only because of COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
in the returned info. |
static int |
MATCH_ENCRYPTION_AWARE
Deprecated.
|
static int |
MATCH_ENCRYPTION_AWARE_AND_UNAWARE
Deprecated.
|
static int |
MATCH_ENCRYPTION_UNAWARE
Deprecated.
|
static int |
MATCH_FACTORY_ONLY
Internal
PackageInfo flag: include only components on the system image. |
static int |
MATCH_SYSTEM_ONLY
Querying flag: include only components from applications that are marked
with
ApplicationInfo.FLAG_SYSTEM . |
static int |
MATCH_UNINSTALLED_PACKAGES
Flag parameter to retrieve some information about all applications (even
uninstalled ones) which have data directories.
|
static long |
MAXIMUM_VERIFICATION_TIMEOUT
Can be used as the
millisecondsToDelay argument for
extendVerificationTimeout(int, int, long) . |
static int |
MOVE_EXTERNAL_MEDIA
Deprecated.
|
static int |
MOVE_FAILED_DEVICE_ADMIN
Error code that is passed to the
IPackageMoveObserver if the
specified package cannot be moved since it contains a device admin. |
static int |
MOVE_FAILED_DOESNT_EXIST
Error code that is passed to the
IPackageMoveObserver if the
specified package doesn't exist. |
static int |
MOVE_FAILED_FORWARD_LOCKED
Error code that is passed to the
IPackageMoveObserver if the
specified package cannot be moved since its forward locked. |
static int |
MOVE_FAILED_INSUFFICIENT_STORAGE
Error code that is passed to the
IPackageMoveObserver when the
package hasn't been successfully moved by the system because of
insufficient memory on specified media. |
static int |
MOVE_FAILED_INTERNAL_ERROR
Error code that is passed to the
IPackageMoveObserver if the
specified package cannot be moved to the specified location. |
static int |
MOVE_FAILED_INVALID_LOCATION
Error code that is passed to the
IPackageMoveObserver if the
specified package cannot be moved to the specified location. |
static int |
MOVE_FAILED_OPERATION_PENDING
Error code that is passed to the
IPackageMoveObserver if the
specified package already has an operation pending in the queue. |
static int |
MOVE_FAILED_SYSTEM_PACKAGE
Error code that is passed to the
IPackageMoveObserver if the
specified package cannot be moved since its a system package. |
static int |
MOVE_INTERNAL
Deprecated.
|
static int |
MOVE_SUCCEEDED
Return code that is passed to the
IPackageMoveObserver when the
package has been successfully moved by the system. |
static int |
NO_NATIVE_LIBRARIES
Internal return code for NativeLibraryHelper methods to indicate that the package
being processed did not contain any native code.
|
static int |
NOTIFY_PACKAGE_USE_ACTIVITY
Used when starting a process for an Activity.
|
static int |
NOTIFY_PACKAGE_USE_BACKUP
Used when starting a process for a BroadcastReceiver.
|
static int |
NOTIFY_PACKAGE_USE_BROADCAST_RECEIVER
Used when starting a process for a BroadcastReceiver.
|
static int |
NOTIFY_PACKAGE_USE_CONTENT_PROVIDER
Used when starting a process for a ContentProvider.
|
static int |
NOTIFY_PACKAGE_USE_CROSS_PACKAGE
Used with Context.getClassLoader() across Android packages.
|
static int |
NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE
Used when moving a Service to the foreground.
|
static int |
NOTIFY_PACKAGE_USE_INSTRUMENTATION
Used when starting a package within a process for Instrumentation.
|
static int |
NOTIFY_PACKAGE_USE_REASONS_COUNT
Total number of usage reasons.
|
static int |
NOTIFY_PACKAGE_USE_SERVICE
Used when starting a process for a Service.
|
static int |
ONLY_IF_NO_MATCH_FOUND
Flag for
addCrossProfileIntentFilter(android.content.IntentFilter, int, int, int) : if this flag is set:
activities in the other profiles can respond to the intent only if no activity with
non-negative priority in current profile can respond to the intent. |
static int |
PERMISSION_DENIED
Permission check result: this is returned by
checkPermission(java.lang.String, java.lang.String)
if the permission has not been granted to the given package. |
static int |
PERMISSION_GRANTED
Permission check result: this is returned by
checkPermission(java.lang.String, java.lang.String)
if the permission has been granted to the given package. |
static int |
SIGNATURE_FIRST_NOT_SIGNED
Signature check result: this is returned by
checkSignatures(java.lang.String, java.lang.String)
if the first package is not signed but the second is. |
static int |
SIGNATURE_MATCH
Signature check result: this is returned by
checkSignatures(java.lang.String, java.lang.String)
if all signatures on the two packages match. |
static int |
SIGNATURE_NEITHER_SIGNED
Signature check result: this is returned by
checkSignatures(java.lang.String, java.lang.String)
if neither of the two packages is signed. |
static int |
SIGNATURE_NO_MATCH
Signature check result: this is returned by
checkSignatures(java.lang.String, java.lang.String)
if not all signatures on both packages match. |
static int |
SIGNATURE_SECOND_NOT_SIGNED
Signature check result: this is returned by
checkSignatures(java.lang.String, java.lang.String)
if the second package is not signed but the first is. |
static int |
SIGNATURE_UNKNOWN_PACKAGE
Signature check result: this is returned by
checkSignatures(java.lang.String, java.lang.String)
if either of the packages are not valid. |
static int |
SKIP_CURRENT_PROFILE
Flag for
addCrossProfileIntentFilter(android.content.IntentFilter, int, int, int) : if this flag is set: when
resolving an intent that matches the CrossProfileIntentFilter ,
the current profile will be skipped. |
static String |
SYSTEM_SHARED_LIBRARY_SERVICES
This is a library that contains components apps can invoke.
|
static String |
SYSTEM_SHARED_LIBRARY_SHARED
This is a library that contains components apps can dynamically
load.
|
static int |
VERIFICATION_ALLOW
Used as the
verificationCode argument for
verifyPendingInstall(int, int) to indicate that the calling
package verifier allows the installation to proceed. |
static int |
VERIFICATION_ALLOW_WITHOUT_SUFFICIENT
Usable by the required verifier as the
verificationCode argument
for verifyPendingInstall(int, int) to indicate that it will
allow the installation to proceed without any of the optional verifiers
needing to vote. |
static int |
VERIFICATION_REJECT
Used as the
verificationCode argument for
verifyPendingInstall(int, int) to indicate the calling
package verifier does not vote to allow the installation to proceed. |
Constructor and Description |
---|
PackageManager() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addCrossProfileIntentFilter(IntentFilter filter,
int sourceUserId,
int targetUserId,
int flags)
Adds a
CrossProfileIntentFilter . |
abstract void |
addOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
Adds a listener for permission changes for installed packages.
|
abstract void |
addPackageToPreferred(String packageName)
Deprecated.
This function no longer does anything; it was an old
approach to managing preferred activities, which has been superseded
by (and conflicts with) the modern activity-based preferences.
|
abstract boolean |
addPermission(PermissionInfo info)
Add a new dynamic permission to the system.
|
abstract boolean |
addPermissionAsync(PermissionInfo info)
Like
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. |
abstract void |
addPreferredActivity(IntentFilter filter,
int match,
ComponentName[] set,
ComponentName activity)
Deprecated.
This is a protected API that should not have been available
to third party applications. It is the platform's responsibility for
assigning preferred activities and this cannot be directly modified.
Add a new preferred activity mapping to the system. This will be used
to automatically select the given activity component when
Context.startActivity() finds
multiple matching activities and also matches the given filter. |
void |
addPreferredActivityAsUser(IntentFilter filter,
int match,
ComponentName[] set,
ComponentName activity,
int userId)
Same as
addPreferredActivity(IntentFilter, int,
ComponentName[], ComponentName) , but with a specific userId to apply the preference
to. |
Intent |
buildRequestPermissionsIntent(String[] permissions)
Returns an
Intent suitable for passing to
Activity.startActivityForResult(android.content.Intent, int)
which prompts the user to grant permissions to this application. |
abstract String[] |
canonicalToCurrentPackageNames(String[] names)
Map from a packages canonical name to the current name in use on the device.
|
abstract int |
checkPermission(String permName,
String pkgName)
Check whether a particular package has been granted a particular
permission.
|
abstract int |
checkSignatures(int uid1,
int uid2)
Like
checkSignatures(String, String) , but takes UIDs of
the two packages to be checked. |
abstract int |
checkSignatures(String pkg1,
String pkg2)
Compare the signatures of two packages to determine if the same
signature appears in both of them.
|
abstract void |
clearApplicationUserData(String packageName,
IPackageDataObserver observer)
Attempts to clear the user data directory of an application.
|
abstract void |
clearCrossProfileIntentFilters(int sourceUserId)
Clearing
CrossProfileIntentFilter s which have the specified user
as their source, and have been set by the app calling this method. |
abstract void |
clearPackagePreferredActivities(String packageName)
Remove all preferred activity mappings, previously added with
addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName) , from the
system whose activities are implemented in the given package name. |
abstract String[] |
currentToCanonicalPackageNames(String[] names)
Map from the current package names in use on the device to whatever
the current canonical name of that package is.
|
abstract void |
deleteApplicationCacheFiles(String packageName,
IPackageDataObserver observer)
Attempts to delete the cache files associated with an application.
|
abstract void |
deleteApplicationCacheFilesAsUser(String packageName,
int userId,
IPackageDataObserver observer)
Attempts to delete the cache files associated with an application for a given user.
|
abstract void |
deletePackage(String packageName,
IPackageDeleteObserver observer,
int flags)
Attempts to delete a package.
|
abstract void |
deletePackageAsUser(String packageName,
IPackageDeleteObserver observer,
int flags,
int userId)
Attempts to delete a package.
|
static int |
deleteStatusToPublicStatus(int status) |
static String |
deleteStatusToString(int status) |
static String |
deleteStatusToString(int status,
String msg) |
abstract void |
extendVerificationTimeout(int id,
int verificationCodeAtTimeout,
long millisecondsToDelay)
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. |
abstract void |
flushPackageRestrictionsAsUser(int userId)
Flush the package restrictions for a given user to disk.
|
void |
freeStorage(long freeStorageSize,
IntentSender pi)
Free storage by deleting LRU sorted list of cache files across
all applications.
|
abstract void |
freeStorage(String volumeUuid,
long freeStorageSize,
IntentSender pi) |
void |
freeStorageAndNotify(long freeStorageSize,
IPackageDataObserver observer)
Free storage by deleting LRU sorted list of cache files across
all applications.
|
abstract void |
freeStorageAndNotify(String volumeUuid,
long freeStorageSize,
IPackageDataObserver observer) |
abstract Drawable |
getActivityBanner(ComponentName activityName)
Retrieve the banner associated with an activity.
|
abstract Drawable |
getActivityBanner(Intent intent)
Retrieve the banner associated with an Intent.
|
abstract Drawable |
getActivityIcon(ComponentName activityName)
Retrieve the icon associated with an activity.
|
abstract Drawable |
getActivityIcon(Intent intent)
Retrieve the icon associated with an Intent.
|
abstract ActivityInfo |
getActivityInfo(ComponentName component,
int flags)
Retrieve all of the information we know about a particular activity
class.
|
abstract Drawable |
getActivityLogo(ComponentName activityName)
Retrieve the logo associated with an activity.
|
abstract Drawable |
getActivityLogo(Intent intent)
Retrieve the logo associated with an Intent.
|
abstract List<IntentFilter> |
getAllIntentFilters(String packageName)
Get the list of IntentFilter for a specific package.
|
abstract List<PermissionGroupInfo> |
getAllPermissionGroups(int flags)
Retrieve all of the known permission groups in the system.
|
abstract Drawable |
getApplicationBanner(ApplicationInfo info)
Retrieve the banner associated with an application.
|
abstract Drawable |
getApplicationBanner(String packageName)
Retrieve the banner associated with an application.
|
abstract int |
getApplicationEnabledSetting(String packageName)
Return the enabled setting for an application.
|
abstract boolean |
getApplicationHiddenSettingAsUser(String packageName,
UserHandle userHandle)
Returns the hidden state of a package.
|
abstract Drawable |
getApplicationIcon(ApplicationInfo info)
Retrieve the icon associated with an application.
|
abstract Drawable |
getApplicationIcon(String packageName)
Retrieve the icon associated with an application.
|
abstract ApplicationInfo |
getApplicationInfo(String packageName,
int flags)
Retrieve all of the information we know about a particular
package/application.
|
abstract ApplicationInfo |
getApplicationInfoAsUser(String packageName,
int flags,
int userId) |
abstract CharSequence |
getApplicationLabel(ApplicationInfo info)
Return the label to use for this application.
|
abstract Drawable |
getApplicationLogo(ApplicationInfo info)
Retrieve the logo associated with an application.
|
abstract Drawable |
getApplicationLogo(String packageName)
Retrieve the logo associated with an application.
|
abstract int |
getComponentEnabledSetting(ComponentName componentName)
Return the enabled setting for a package component (activity,
receiver, service, provider).
|
abstract Drawable |
getDefaultActivityIcon()
Return the generic icon for an activity that is used when no specific
icon is defined.
|
abstract String |
getDefaultBrowserPackageNameAsUser(int userId)
Get the default Browser package name for a specific user.
|
abstract Drawable |
getDrawable(String packageName,
int resid,
ApplicationInfo appInfo)
Retrieve an image from a package.
|
abstract Drawable |
getEphemeralApplicationIcon(String packageName)
Gets the icon for an ephemeral application.
|
abstract List<EphemeralApplicationInfo> |
getEphemeralApplications()
Gets the ephemeral applications the user recently used.
|
abstract byte[] |
getEphemeralCookie()
Gets the ephemeral application cookie for this app.
|
abstract int |
getEphemeralCookieMaxSizeBytes()
Gets the maximum size in bytes of the cookie data an ephemeral app
can store on the device.
|
abstract ComponentName |
getHomeActivities(List<ResolveInfo> outActivities)
Ask for the set of available 'home' activities and the current explicit
default, if any.
|
abstract List<ApplicationInfo> |
getInstalledApplications(int flags)
Return a List of all application packages that are installed on the
device.
|
abstract List<PackageInfo> |
getInstalledPackages(int flags)
Return a List of all packages that are installed
on the device.
|
abstract List<PackageInfo> |
getInstalledPackagesAsUser(int flags,
int userId)
Return a List of all packages that are installed on the device, for a specific user.
|
abstract String |
getInstallerPackageName(String packageName)
Retrieve the package name of the application that installed a package.
|
abstract InstrumentationInfo |
getInstrumentationInfo(ComponentName className,
int flags)
Retrieve all of the information we know about a particular
instrumentation class.
|
abstract List<IntentFilterVerificationInfo> |
getIntentFilterVerifications(String packageName)
Get the list of IntentFilterVerificationInfo for a specific package and User.
|
abstract int |
getIntentVerificationStatusAsUser(String packageName,
int userId)
Get the status of a Domain Verification Result for an IntentFilter.
|
abstract KeySet |
getKeySetByAlias(String packageName,
String alias)
Return the
KeySet associated with the String alias for this
application. |
abstract Intent |
getLaunchIntentForPackage(String packageName)
Returns a "good" intent to launch a front-door activity in a package.
|
abstract Intent |
getLeanbackLaunchIntentForPackage(String packageName)
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.
|
abstract Drawable |
getManagedUserBadgedDrawable(Drawable drawable,
Rect badgeLocation,
int badgeDensity)
Returns a managed-user-style badged copy of the given drawable allowing the user to
distinguish it from the original drawable.
|
abstract int |
getMoveStatus(int moveId) |
abstract String |
getNameForUid(int uid)
Retrieve the official name associated with a user id.
|
PackageInfo |
getPackageArchiveInfo(String archiveFilePath,
int flags)
Retrieve overall information about an application package defined
in a package archive file
|
abstract List<VolumeInfo> |
getPackageCandidateVolumes(ApplicationInfo app) |
abstract VolumeInfo |
getPackageCurrentVolume(ApplicationInfo app) |
abstract int[] |
getPackageGids(String packageName)
Return an array of all of the POSIX secondary group IDs that have been
assigned to the given package.
|
abstract int[] |
getPackageGids(String packageName,
int flags)
Return an array of all of the POSIX secondary group IDs that have been
assigned to the given package.
|
abstract PackageInfo |
getPackageInfo(String packageName,
int flags)
Retrieve overall information about an application package that is
installed on the system.
|
abstract PackageInfo |
getPackageInfoAsUser(String packageName,
int flags,
int userId) |
abstract PackageInstaller |
getPackageInstaller()
Return interface that offers the ability to install, upgrade, and remove
applications on the device.
|
abstract String[] |
getPackagesForUid(int uid)
Retrieve the names of all packages that are associated with a particular
user id.
|
abstract List<PackageInfo> |
getPackagesHoldingPermissions(String[] permissions,
int flags)
Return a List of all installed packages that are currently
holding any of the given permissions.
|
void |
getPackageSizeInfo(String packageName,
IPackageStatsObserver observer)
Like
getPackageSizeInfoAsUser(String, int, IPackageStatsObserver) , but
returns the size for the calling user. |
abstract void |
getPackageSizeInfoAsUser(String packageName,
int userId,
IPackageStatsObserver observer)
Retrieve the size information for a package.
|
abstract int |
getPackageUid(String packageName,
int flags)
Return the UID associated with the given package name.
|
abstract int |
getPackageUidAsUser(String packageName,
int userId)
Return the UID associated with the given package name.
|
abstract int |
getPackageUidAsUser(String packageName,
int flags,
int userId)
Return the UID associated with the given package name.
|
abstract String |
getPermissionControllerPackageName()
Gets the package name of the component controlling runtime permissions.
|
abstract int |
getPermissionFlags(String permissionName,
String packageName,
UserHandle user)
Gets the state flags associated with a permission.
|
abstract PermissionGroupInfo |
getPermissionGroupInfo(String name,
int flags)
Retrieve all of the information we know about a particular group of
permissions.
|
abstract PermissionInfo |
getPermissionInfo(String name,
int flags)
Retrieve all of the information we know about a particular permission.
|
abstract int |
getPreferredActivities(List<IntentFilter> outFilters,
List<ComponentName> outActivities,
String packageName)
Retrieve all preferred activities, previously added with
addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName) , that are
currently registered with the system. |
abstract List<PackageInfo> |
getPreferredPackages(int flags)
Retrieve the list of all currently configured preferred packages.
|
abstract List<VolumeInfo> |
getPrimaryStorageCandidateVolumes() |
abstract VolumeInfo |
getPrimaryStorageCurrentVolume() |
abstract ProviderInfo |
getProviderInfo(ComponentName component,
int flags)
Retrieve all of the information we know about a particular content
provider class.
|
abstract ActivityInfo |
getReceiverInfo(ComponentName component,
int flags)
Retrieve all of the information we know about a particular receiver
class.
|
abstract Resources |
getResourcesForActivity(ComponentName activityName)
Retrieve the resources associated with an activity.
|
abstract Resources |
getResourcesForApplication(ApplicationInfo app)
Retrieve the resources for an application.
|
abstract Resources |
getResourcesForApplication(String appPackageName)
Retrieve the resources associated with an application.
|
abstract Resources |
getResourcesForApplicationAsUser(String appPackageName,
int userId) |
abstract ServiceInfo |
getServiceInfo(ComponentName component,
int flags)
Retrieve all of the information we know about a particular service class.
|
abstract String |
getServicesSystemSharedLibraryPackageName()
Get the name of the package hosting the services shared library.
|
abstract String |
getSharedSystemSharedLibraryPackageName()
Get the name of the package hosting the shared components shared library.
|
abstract KeySet |
getSigningKeySet(String packageName)
Return the signing
KeySet for this application. |
abstract FeatureInfo[] |
getSystemAvailableFeatures()
Get a list of features that are available on the
system.
|
abstract String[] |
getSystemSharedLibraryNames()
Get a list of shared libraries that are available on the
system.
|
abstract CharSequence |
getText(String packageName,
int resid,
ApplicationInfo appInfo)
Retrieve text from a package.
|
abstract int |
getUidForSharedUser(String sharedUserName)
Return the user id associated with a shared user name.
|
abstract Drawable |
getUserBadgedDrawableForDensity(Drawable drawable,
UserHandle user,
Rect badgeLocation,
int badgeDensity)
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.
|
abstract Drawable |
getUserBadgedIcon(Drawable icon,
UserHandle user)
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.
|
abstract CharSequence |
getUserBadgedLabel(CharSequence label,
UserHandle user)
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.
|
abstract Drawable |
getUserBadgeForDensity(UserHandle user,
int density)
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.
|
abstract Drawable |
getUserBadgeForDensityNoBackground(UserHandle user,
int density)
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.
|
abstract VerifierDeviceIdentity |
getVerifierDeviceIdentity()
Returns the device identity that verifiers can use to associate their scheme to a particular
device.
|
abstract XmlResourceParser |
getXml(String packageName,
int resid,
ApplicationInfo appInfo)
Retrieve an XML file from a package.
|
abstract void |
grantRuntimePermission(String packageName,
String permissionName,
UserHandle user)
Grant a runtime permission to an application which the application does not
already have.
|
abstract boolean |
hasSystemFeature(String name)
Check whether the given feature name is one of the available features as
returned by
getSystemAvailableFeatures() . |
abstract boolean |
hasSystemFeature(String name,
int version)
Check whether the given feature name and version is one of the available
features as returned by
getSystemAvailableFeatures() . |
abstract int |
installExistingPackage(String packageName)
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.
|
abstract int |
installExistingPackageAsUser(String packageName,
int userId)
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.
|
abstract void |
installPackage(Uri packageURI,
IPackageInstallObserver observer,
int flags,
String installerPackageName)
Deprecated.
replaced by
PackageInstaller |
static int |
installStatusToPublicStatus(int status) |
static String |
installStatusToString(int status) |
static String |
installStatusToString(int status,
String msg) |
abstract boolean |
isEphemeralApplication()
Gets whether the caller is an ephemeral app.
|
static boolean |
isMoveStatusFinished(int status) |
abstract boolean |
isPackageAvailable(String packageName) |
abstract boolean |
isPackageSuspendedForUser(String packageName,
int userId) |
abstract boolean |
isPermissionRevokedByPolicy(String permName,
String pkgName)
Checks whether a particular permissions has been revoked for a
package by policy.
|
abstract boolean |
isSafeMode()
Return whether the device has been booted into safe mode.
|
abstract boolean |
isSignedBy(String packageName,
KeySet ks)
Return whether the package denoted by packageName has been signed by all
of the keys specified by the
KeySet ks. |
abstract boolean |
isSignedByExactly(String packageName,
KeySet ks)
Return whether the package denoted by packageName has been signed by all
of, and only, the keys specified by the
KeySet ks. |
abstract boolean |
isUpgrade()
Returns true if the device is upgrading, such as first boot after OTA.
|
abstract Drawable |
loadItemIcon(PackageItemInfo itemInfo,
ApplicationInfo appInfo) |
abstract Drawable |
loadUnbadgedItemIcon(PackageItemInfo itemInfo,
ApplicationInfo appInfo) |
abstract int |
movePackage(String packageName,
VolumeInfo vol) |
abstract int |
movePrimaryStorage(VolumeInfo vol) |
static String |
permissionFlagToString(int flag) |
abstract List<ResolveInfo> |
queryBroadcastReceivers(Intent intent,
int flags)
Retrieve all receivers that can handle a broadcast of the given intent.
|
List<ResolveInfo> |
queryBroadcastReceivers(Intent intent,
int flags,
int userId)
Deprecated.
|
abstract List<ResolveInfo> |
queryBroadcastReceiversAsUser(Intent intent,
int flags,
int userId) |
List<ResolveInfo> |
queryBroadcastReceiversAsUser(Intent intent,
int flags,
UserHandle userHandle)
Retrieve all receivers that can handle a broadcast of the given intent,
for a specific user.
|
abstract List<ProviderInfo> |
queryContentProviders(String processName,
int uid,
int flags)
Retrieve content provider information.
|
abstract List<InstrumentationInfo> |
queryInstrumentation(String targetPackage,
int flags)
Retrieve information about available instrumentation code.
|
abstract List<ResolveInfo> |
queryIntentActivities(Intent intent,
int flags)
Retrieve all activities that can be performed for the given intent.
|
abstract List<ResolveInfo> |
queryIntentActivitiesAsUser(Intent intent,
int flags,
int userId)
Retrieve all activities that can be performed for the given intent, for a
specific user.
|
abstract List<ResolveInfo> |
queryIntentActivityOptions(ComponentName caller,
Intent[] specifics,
Intent intent,
int flags)
Retrieve a set of activities that should be presented to the user as
similar options.
|
abstract List<ResolveInfo> |
queryIntentContentProviders(Intent intent,
int flags)
Retrieve all providers that can match the given intent.
|
abstract List<ResolveInfo> |
queryIntentContentProvidersAsUser(Intent intent,
int flags,
int userId)
Retrieve all providers that can match the given intent.
|
abstract List<ResolveInfo> |
queryIntentServices(Intent intent,
int flags)
Retrieve all services that can match the given intent.
|
abstract List<ResolveInfo> |
queryIntentServicesAsUser(Intent intent,
int flags,
int userId)
Retrieve all services that can match the given intent for a given user.
|
abstract List<PermissionInfo> |
queryPermissionsByGroup(String group,
int flags)
Query for all of the permissions associated with a particular group.
|
abstract void |
registerMoveCallback(PackageManager.MoveCallback callback,
Handler handler) |
abstract void |
removeOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
Remvoes a listener for permission changes for installed packages.
|
abstract void |
removePackageFromPreferred(String packageName)
Deprecated.
This function no longer does anything; it was an old
approach to managing preferred activities, which has been superseded
by (and conflicts with) the modern activity-based preferences.
|
abstract void |
removePermission(String name)
Removes a permission that was previously added with
addPermission(PermissionInfo) . |
abstract void |
replacePreferredActivity(IntentFilter filter,
int match,
ComponentName[] set,
ComponentName activity)
Deprecated.
This is a protected API that should not have been available
to third party applications. It is the platform's responsibility for
assigning preferred activities and this cannot be directly modified.
Replaces an existing preferred activity mapping to the system, and if that were not present
adds a new preferred activity. This will be used
to automatically select the given activity component when
Context.startActivity() finds
multiple matching activities and also matches the given filter. |
void |
replacePreferredActivityAsUser(IntentFilter filter,
int match,
ComponentName[] set,
ComponentName activity,
int userId)
Deprecated.
|
abstract ResolveInfo |
resolveActivity(Intent intent,
int flags)
Determine the best action to perform for a given Intent.
|
abstract ResolveInfo |
resolveActivityAsUser(Intent intent,
int flags,
int userId)
Determine the best action to perform for a given Intent for a given user.
|
abstract ProviderInfo |
resolveContentProvider(String name,
int flags)
Find a single content provider by its base path name.
|
abstract ProviderInfo |
resolveContentProviderAsUser(String name,
int flags,
int userId)
Find a single content provider by its base path name.
|
abstract ResolveInfo |
resolveService(Intent intent,
int flags)
Determine the best service to handle for a given Intent.
|
abstract void |
revokeRuntimePermission(String packageName,
String permissionName,
UserHandle user)
Revoke a runtime permission that was previously granted by
grantRuntimePermission(String, String, android.os.UserHandle) . |
abstract void |
setApplicationEnabledSetting(String packageName,
int newState,
int flags)
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.
|
abstract boolean |
setApplicationHiddenSettingAsUser(String packageName,
boolean hidden,
UserHandle userHandle)
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.
|
abstract void |
setComponentEnabledSetting(ComponentName componentName,
int newState,
int flags)
Set the enabled setting for a package component (activity, receiver, service, provider).
|
abstract boolean |
setDefaultBrowserPackageNameAsUser(String packageName,
int userId)
Set the default Browser package name for a specific user.
|
abstract boolean |
setEphemeralCookie(byte[] cookie)
Sets the ephemeral application cookie for the calling app.
|
abstract void |
setInstallerPackageName(String targetPackage,
String installerPackageName)
Change the installer associated with a given package.
|
abstract String[] |
setPackagesSuspendedAsUser(String[] packageNames,
boolean suspended,
int userId)
Puts the package in a suspended state, where attempts at starting activities are denied.
|
abstract boolean |
shouldShowRequestPermissionRationale(String permission)
Gets whether you should show UI with rationale for requesting a permission.
|
abstract void |
unregisterMoveCallback(PackageManager.MoveCallback callback) |
abstract boolean |
updateIntentVerificationStatusAsUser(String packageName,
int status,
int userId)
Allow to change the status of a Intent Verification status for all IntentFilter of an App.
|
abstract void |
updatePermissionFlags(String permissionName,
String packageName,
int flagMask,
int flagValues,
UserHandle user)
Updates the flags associated with a permission by replacing the flags in
the specified mask with the provided flag values.
|
abstract void |
verifyIntentFilter(int verificationId,
int verificationCode,
List<String> failedDomains)
Allows a package listening to the
Intent.ACTION_INTENT_FILTER_NEEDS_VERIFICATION intent filter verification
broadcast to respond to the package manager. |
abstract void |
verifyPendingInstall(int id,
int verificationCode)
Allows a package listening to the
package verification
broadcast to respond to the package manager. |
public static final boolean APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE
public static final int GET_ACTIVITIES
PackageInfo
flag: return information about
activities in the package in PackageInfo.activities
.public static final int GET_RECEIVERS
PackageInfo
flag: return information about
intent receivers in the package in
PackageInfo.receivers
.public static final int GET_SERVICES
PackageInfo
flag: return information about
services in the package in PackageInfo.services
.public static final int GET_PROVIDERS
PackageInfo
flag: return information about
content providers in the package in
PackageInfo.providers
.public static final int GET_INSTRUMENTATION
PackageInfo
flag: return information about
instrumentation in the package in
PackageInfo.instrumentation
.public static final int GET_INTENT_FILTERS
PackageInfo
flag: return information about the
intent filters supported by the activity.public static final int GET_SIGNATURES
PackageInfo
flag: return information about the
signatures included in the package.public static final int GET_RESOLVED_FILTER
ResolveInfo
flag: return the IntentFilter that
was matched for a particular ResolveInfo in
ResolveInfo.filter
.public static final int GET_META_DATA
ComponentInfo
flag: return the PackageItemInfo.metaData
data Bundle
s that are associated with a component.
This applies for any API returning a ComponentInfo subclass.public static final int GET_GIDS
PackageInfo
flag: return the
group ids
that are associated with an
application.
This applies for any API returning a PackageInfo class, either
directly or nested inside of another.@Deprecated public static final int GET_DISABLED_COMPONENTS
MATCH_DISABLED_COMPONENTS
public static final int MATCH_DISABLED_COMPONENTS
PackageInfo
flag: include disabled components in the returned info.public static final int GET_SHARED_LIBRARY_FILES
ApplicationInfo
flag: return the
paths to the shared libraries
that are associated with an application.
This applies for any API returning an ApplicationInfo class, either
directly or nested inside of another.public static final int GET_URI_PERMISSION_PATTERNS
ProviderInfo
flag: return the
URI permission patterns
that are associated with a content provider.
This applies for any API returning a ProviderInfo class, either
directly or nested inside of another.public static final int GET_PERMISSIONS
PackageInfo
flag: return information about
permissions in the package in
PackageInfo.permissions
.@Deprecated public static final int GET_UNINSTALLED_PACKAGES
MATCH_UNINSTALLED_PACKAGES
public static final int MATCH_UNINSTALLED_PACKAGES
DONT_DELETE_DATA
with a possibility of being replaced or
reinstalled in future.
Note: this flag may cause less information about currently installed applications to be returned.
public static final int GET_CONFIGURATIONS
PackageInfo
flag: return information about
hardware preferences in
PackageInfo.configPreferences
,
and requested features in PackageInfo.reqFeatures
and
PackageInfo.featureGroups
.@Deprecated public static final int GET_DISABLED_UNTIL_USED_COMPONENTS
MATCH_DISABLED_UNTIL_USED_COMPONENTS
.public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS
PackageInfo
flag: include disabled components which are in
that state only because of COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
in the returned info. Note that if you set this flag, applications
that are in this disabled state will be reported as enabled.public static final int MATCH_DEFAULT_ONLY
Intent.CATEGORY_DEFAULT
will be considered for
matching. This is a synonym for including the CATEGORY_DEFAULT in your
supplied Intent.public static final int MATCH_ALL
This flag should be used with extreme care.
public static final int MATCH_DIRECT_BOOT_UNAWARE
When neither MATCH_DIRECT_BOOT_AWARE
nor
MATCH_DIRECT_BOOT_UNAWARE
are specified, the default behavior is
to match only runnable components based on the user state. For example,
when a user is started but credentials have not been presented yet, the
user is running "locked" and only MATCH_DIRECT_BOOT_AWARE
components are returned. Once the user credentials have been presented,
the user is running "unlocked" and both MATCH_DIRECT_BOOT_AWARE
and MATCH_DIRECT_BOOT_UNAWARE
components are returned.
public static final int MATCH_DIRECT_BOOT_AWARE
When neither MATCH_DIRECT_BOOT_AWARE
nor
MATCH_DIRECT_BOOT_UNAWARE
are specified, the default behavior is
to match only runnable components based on the user state. For example,
when a user is started but credentials have not been presented yet, the
user is running "locked" and only MATCH_DIRECT_BOOT_AWARE
components are returned. Once the user credentials have been presented,
the user is running "unlocked" and both MATCH_DIRECT_BOOT_AWARE
and MATCH_DIRECT_BOOT_UNAWARE
components are returned.
@Deprecated public static final int MATCH_ENCRYPTION_UNAWARE
@Deprecated public static final int MATCH_ENCRYPTION_AWARE
@Deprecated public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE
public static final int MATCH_SYSTEM_ONLY
ApplicationInfo.FLAG_SYSTEM
.public static final int MATCH_FACTORY_ONLY
PackageInfo
flag: include only components on the system image.
This will not return information on any unbundled update to system components.public static final int MATCH_DEBUG_TRIAGED_MISSING
public static final int SKIP_CURRENT_PROFILE
addCrossProfileIntentFilter(android.content.IntentFilter, int, int, int)
: if this flag is set: when
resolving an intent that matches the CrossProfileIntentFilter
,
the current profile will be skipped. Only activities in the target user
can respond to the intent.public static final int ONLY_IF_NO_MATCH_FOUND
addCrossProfileIntentFilter(android.content.IntentFilter, int, int, int)
: if this flag is set:
activities in the other profiles can respond to the intent only if no activity with
non-negative priority in current profile can respond to the intent.public static final int PERMISSION_GRANTED
checkPermission(java.lang.String, java.lang.String)
if the permission has been granted to the given package.public static final int PERMISSION_DENIED
checkPermission(java.lang.String, java.lang.String)
if the permission has not been granted to the given package.public static final int SIGNATURE_MATCH
checkSignatures(java.lang.String, java.lang.String)
if all signatures on the two packages match.public static final int SIGNATURE_NEITHER_SIGNED
checkSignatures(java.lang.String, java.lang.String)
if neither of the two packages is signed.public static final int SIGNATURE_FIRST_NOT_SIGNED
checkSignatures(java.lang.String, java.lang.String)
if the first package is not signed but the second is.public static final int SIGNATURE_SECOND_NOT_SIGNED
checkSignatures(java.lang.String, java.lang.String)
if the second package is not signed but the first is.public static final int SIGNATURE_NO_MATCH
checkSignatures(java.lang.String, java.lang.String)
if not all signatures on both packages match.public static final int SIGNATURE_UNKNOWN_PACKAGE
checkSignatures(java.lang.String, java.lang.String)
if either of the packages are not valid.public static final int COMPONENT_ENABLED_STATE_DEFAULT
setApplicationEnabledSetting(String, int, int)
and setComponentEnabledSetting(ComponentName, int, int)
: This
component or application is in its default enabled state (as specified
in its manifest).public static final int COMPONENT_ENABLED_STATE_ENABLED
setApplicationEnabledSetting(String, int, int)
and setComponentEnabledSetting(ComponentName, int, int)
: This
component or application has been explictily enabled, regardless of
what it has specified in its manifest.public static final int COMPONENT_ENABLED_STATE_DISABLED
setApplicationEnabledSetting(String, int, int)
and setComponentEnabledSetting(ComponentName, int, int)
: This
component or application has been explicitly disabled, regardless of
what it has specified in its manifest.public static final int COMPONENT_ENABLED_STATE_DISABLED_USER
setApplicationEnabledSetting(String, int, int)
only: The
user has explicitly disabled the application, regardless of what it has
specified in its manifest. Because this is due to the user's request,
they may re-enable it if desired through the appropriate system UI. This
option currently cannot be used with
setComponentEnabledSetting(ComponentName, int, int)
.public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
setApplicationEnabledSetting(String, int, int)
only: This
application should be considered, until the point where the user actually
wants to use it. This means that it will not normally show up to the user
(such as in the launcher), but various parts of the user interface can
use GET_DISABLED_UNTIL_USED_COMPONENTS
to still see it and allow
the user to select it (as for example an IME, device admin, etc). Such code,
once the user has selected the app, should at that point also make it enabled.
This option currently can not be used with
setComponentEnabledSetting(ComponentName, int, int)
.public static final int INSTALL_FORWARD_LOCK
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this package
should be installed as forward locked, i.e. only the app itself should
have access to its code and non-resource assets.public static final int INSTALL_REPLACE_EXISTING
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that you want to
replace an already installed package, if one exists.public static final int INSTALL_ALLOW_TEST
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that you want to
allow test packages (those that have set android:testOnly in their
manifest) to be installed.public static final int INSTALL_EXTERNAL
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this package
must be installed to an ASEC on a VolumeInfo.TYPE_PUBLIC
.public static final int INSTALL_INTERNAL
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this package
must be installed to internal storage.public static final int INSTALL_FROM_ADB
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this install
was initiated via ADB.public static final int INSTALL_ALL_USERS
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this install
should immediately be visible to all users.public static final int INSTALL_ALLOW_DOWNGRADE
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that it is okay
to install an update to an app where the newly installed app has a lower
version code than the currently installed app. This is permitted only if
the currently installed app is marked debuggable.public static final int INSTALL_GRANT_RUNTIME_PERMISSIONS
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that all runtime
permissions should be granted to the package. If INSTALL_ALL_USERS
is set the runtime permissions will be granted to all users, otherwise
only to the owner.public static final int INSTALL_FORCE_VOLUME_UUID
public static final int INSTALL_FORCE_PERMISSION_PROMPT
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that we always want to force
the prompt for permission approval. This overrides any special behaviour for internal
components.public static final int INSTALL_EPHEMERAL
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this package is
to be installed as a lightweight "ephemeral" app.public static final int INSTALL_DONT_KILL_APP
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this package contains
a feature split to an existing application and the existing application should not
be killed during the installation process.public static final int INSTALL_FORCE_SDK
installPackage(android.net.Uri, IPackageInstallObserver, int, java.lang.String)
to indicate that this package is an
upgrade to a package that refers to the SDK via release letter.public static final int DONT_KILL_APP
setComponentEnabledSetting(android.content.ComponentName, int, int)
to indicate
that you don't want to kill the app containing the component. Be careful when you set this
since changing component states can make the containing application's behavior unpredictable.public static final int INSTALL_SUCCEEDED
IPackageInstallObserver
on success.public static final int INSTALL_FAILED_ALREADY_EXISTS
IPackageInstallObserver
if the package is already installed.public static final int INSTALL_FAILED_INVALID_APK
IPackageInstallObserver
if the package archive file is invalid.public static final int INSTALL_FAILED_INVALID_URI
IPackageInstallObserver
if the URI passed in is invalid.public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE
IPackageInstallObserver
if the package manager service found that
the device didn't have enough storage space to install the app.public static final int INSTALL_FAILED_DUPLICATE_PACKAGE
IPackageInstallObserver
if a package is already installed with
the same name.public static final int INSTALL_FAILED_NO_SHARED_USER
IPackageInstallObserver
if the requested shared user does not
exist.public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE
IPackageInstallObserver
if a previously installed package of the
same name has a different signature than the new package (and the old
package's data was not removed).public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE
IPackageInstallObserver
if the new package is requested a shared
user which is already installed on the device and does not have matching
signature.public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY
IPackageInstallObserver
if the new package uses a shared library
that is not available.public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE
IPackageInstallObserver
if the new package uses a shared library
that is not available.public static final int INSTALL_FAILED_DEXOPT
IPackageInstallObserver
if the new package failed while
optimizing and validating its dex files, either because there was not
enough storage or the validation failed.public static final int INSTALL_FAILED_OLDER_SDK
IPackageInstallObserver
if the new package failed because the
current SDK version is older than that required by the package.public static final int INSTALL_FAILED_CONFLICTING_PROVIDER
IPackageInstallObserver
if the new package failed because it
contains a content provider with the same authority as a provider already
installed in the system.public static final int INSTALL_FAILED_NEWER_SDK
IPackageInstallObserver
if the new package failed because the
current SDK version is newer than that required by the package.public static final int INSTALL_FAILED_TEST_ONLY
IPackageInstallObserver
if the new package failed because it has
specified that it is a test-only package and the caller has not supplied
the INSTALL_ALLOW_TEST
flag.public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE
IPackageInstallObserver
if the package being installed contains
native code, but none that is compatible with the device's CPU_ABI.public static final int INSTALL_FAILED_MISSING_FEATURE
IPackageInstallObserver
if the new package uses a feature that is
not available.public static final int INSTALL_FAILED_CONTAINER_ERROR
IPackageInstallObserver
if a secure container mount point
couldn't be accessed on external media.public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION
IPackageInstallObserver
if the new package couldn't be installed
in the specified install location.public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE
IPackageInstallObserver
if the new package couldn't be installed
in the specified install location because the media is not available.public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT
IPackageInstallObserver
if the new package couldn't be installed
because the verification timed out.public static final int INSTALL_FAILED_VERIFICATION_FAILURE
IPackageInstallObserver
if the new package couldn't be installed
because the verification did not succeed.public static final int INSTALL_FAILED_PACKAGE_CHANGED
IPackageInstallObserver
if the package changed from what the
calling program expected.public static final int INSTALL_FAILED_UID_CHANGED
IPackageInstallObserver
if the new package is assigned a
different UID than it previously held.public static final int INSTALL_FAILED_VERSION_DOWNGRADE
IPackageInstallObserver
if the new package has an older version
code than the currently installed package.public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE
IPackageInstallObserver
if the old package has target SDK high
enough to support runtime permission and the new package has target SDK
low enough to not support runtime permissions.public static final int INSTALL_PARSE_FAILED_NOT_APK
IPackageInstallObserver
if the parser was given a path that is
not a file, or does not end with the expected '.apk' extension.public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST
IPackageInstallObserver
if the parser was unable to retrieve the
AndroidManifest.xml file.public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION
IPackageInstallObserver
if the parser encountered an unexpected
exception.public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES
IPackageInstallObserver
if the parser did not find any
certificates in the .apk.public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
IPackageInstallObserver
if the parser found inconsistent
certificates on the files in the .apk.public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING
IPackageInstallObserver
if the parser encountered a
CertificateEncodingException in one of the files in the .apk.public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME
IPackageInstallObserver
if the parser encountered a bad or
missing package name in the manifest.public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID
IPackageInstallObserver
if the parser encountered a bad shared
user id name in the manifest.public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
IPackageInstallObserver
if the parser encountered some structural
problem in the manifest.public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY
IPackageInstallObserver
if the parser did not find any actionable
tags (instrumentation or application) in the manifest.public static final int INSTALL_FAILED_INTERNAL_ERROR
IPackageInstallObserver
if the system failed to install the
package because of system issues.public static final int INSTALL_FAILED_USER_RESTRICTED
IPackageInstallObserver
if the system failed to install the
package because the user is restricted from installing apps.public static final int INSTALL_FAILED_DUPLICATE_PERMISSION
IPackageInstallObserver
if the system failed to install the
package because it is attempting to define a permission that is already
defined by some existing package.
The package name of the app which has already defined the permission is
passed to a PackageInstallObserver
, if any, as the
EXTRA_FAILURE_EXISTING_PACKAGE
string extra; and the name of the
permission being redefined is passed in the
EXTRA_FAILURE_EXISTING_PERMISSION
string extra.
public static final int INSTALL_FAILED_NO_MATCHING_ABIS
IPackageInstallObserver
if the system failed to install the
package because its packaged native code did not match any of the ABIs
supported by the system.public static final int NO_NATIVE_LIBRARIES
public static final int INSTALL_FAILED_ABORTED
public static final int INSTALL_FAILED_EPHEMERAL_INVALID
public static final int DELETE_KEEP_DATA
deletePackage(java.lang.String, IPackageDeleteObserver, int)
to indicate that you don't want to delete the
package's data directory.public static final int DELETE_ALL_USERS
deletePackage(java.lang.String, IPackageDeleteObserver, int)
to indicate that you want the
package deleted for all users.public static final int DELETE_SYSTEM_APP
deletePackage(java.lang.String, IPackageDeleteObserver, int)
to indicate that, if you are calling
uninstall on a system that has been updated, then don't do the normal process
of uninstalling the update and rolling back to the older system version (which
needs to happen for all users); instead, just mark the app as uninstalled for
the current user.public static final int DELETE_DONT_KILL_APP
deletePackage(java.lang.String, IPackageDeleteObserver, int)
to indicate that, if you are calling
uninstall on a package that is replaced to provide new feature splits, the
existing application should not be killed during the removal process.public static final int DELETE_SUCCEEDED
IPackageDeleteObserver
if the system succeeded in deleting the
package.public static final int DELETE_FAILED_INTERNAL_ERROR
IPackageDeleteObserver
if the system failed to delete the package
for an unspecified reason.public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER
IPackageDeleteObserver
if the system failed to delete the package
because it is the active DevicePolicy manager.public static final int DELETE_FAILED_USER_RESTRICTED
IPackageDeleteObserver
if the system failed to delete the package
since the user is restricted.public static final int DELETE_FAILED_OWNER_BLOCKED
IPackageDeleteObserver
if the system failed to delete the package
because a profile or device owner has marked the package as
uninstallable.public static final int DELETE_FAILED_ABORTED
public static final int MOVE_SUCCEEDED
IPackageMoveObserver
when the
package has been successfully moved by the system.public static final int MOVE_FAILED_INSUFFICIENT_STORAGE
IPackageMoveObserver
when the
package hasn't been successfully moved by the system because of
insufficient memory on specified media.public static final int MOVE_FAILED_DOESNT_EXIST
IPackageMoveObserver
if the
specified package doesn't exist.public static final int MOVE_FAILED_SYSTEM_PACKAGE
IPackageMoveObserver
if the
specified package cannot be moved since its a system package.public static final int MOVE_FAILED_FORWARD_LOCKED
IPackageMoveObserver
if the
specified package cannot be moved since its forward locked.public static final int MOVE_FAILED_INVALID_LOCATION
IPackageMoveObserver
if the
specified package cannot be moved to the specified location.public static final int MOVE_FAILED_INTERNAL_ERROR
IPackageMoveObserver
if the
specified package cannot be moved to the specified location.public static final int MOVE_FAILED_OPERATION_PENDING
IPackageMoveObserver
if the
specified package already has an operation pending in the queue.public static final int MOVE_FAILED_DEVICE_ADMIN
IPackageMoveObserver
if the
specified package cannot be moved since it contains a device admin.@Deprecated public static final int MOVE_INTERNAL
movePackage(java.lang.String, android.os.storage.VolumeInfo)
to indicate that
the package should be moved to internal storage if its
been installed on external media.@Deprecated public static final int MOVE_EXTERNAL_MEDIA
movePackage(java.lang.String, android.os.storage.VolumeInfo)
to indicate that
the package should be moved to external media.public static final String EXTRA_MOVE_ID
public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT
verificationCode
argument
for verifyPendingInstall(int, int)
to indicate that it will
allow the installation to proceed without any of the optional verifiers
needing to vote.public static final int VERIFICATION_ALLOW
verificationCode
argument for
verifyPendingInstall(int, int)
to indicate that the calling
package verifier allows the installation to proceed.public static final int VERIFICATION_REJECT
verificationCode
argument for
verifyPendingInstall(int, int)
to indicate the calling
package verifier does not vote to allow the installation to proceed.public static final int INTENT_FILTER_VERIFICATION_SUCCESS
verificationCode
argument for
verifyIntentFilter(int, int, java.util.List<java.lang.String>)
to indicate that the calling
IntentFilter Verifier confirms that the IntentFilter is verified.public static final int INTENT_FILTER_VERIFICATION_FAILURE
verificationCode
argument for
verifyIntentFilter(int, int, java.util.List<java.lang.String>)
to indicate that the calling
IntentFilter Verifier confirms that the IntentFilter is NOT verified.public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED
public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK
status
argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int)
to indicate that the User
will always be prompted the Intent Disambiguation Dialog if there are two
or more Intent resolved for the IntentFilter's domain(s).public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS
status
argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int)
to indicate that the User
will never be prompted the Intent Disambiguation Dialog if there are two
or more resolution of the Intent. The default App for the domain(s)
specified in the IntentFilter will also ALWAYS be used.public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER
status
argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int)
to indicate that the User
may be prompted the Intent Disambiguation Dialog if there are two or more
Intent resolved. The default App for the domain(s) specified in the
IntentFilter will also NEVER be presented to the User.public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK
status
argument for
updateIntentVerificationStatusAsUser(java.lang.String, int, int)
to indicate that this app
should always be considered as an ambiguous candidate for handling the
matching Intent even if there are other candidate apps in the "always"
state. Put another way: if there are any 'always ask' apps in a set of
more than one candidate app, then a disambiguation is *always* presented
even if there is another candidate app with the 'always' state.public static final long MAXIMUM_VERIFICATION_TIMEOUT
millisecondsToDelay
argument for
extendVerificationTimeout(int, int, long)
. This is the
maximum time PackageManager
waits for the verification
agent to return (in milliseconds).public static final String FEATURE_AUDIO_LOW_LATENCY
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
: The device's
audio pipeline is low-latency, more suitable for audio applications sensitive to delays or
lag in sound input or output.public static final String FEATURE_AUDIO_OUTPUT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes at least one form of audio
output, such as speakers, audio jack or streaming over bluetoothpublic static final String FEATURE_AUDIO_PRO
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device has professional audio level of functionality and performance.public static final String FEATURE_BLUETOOTH
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device is capable of communicating with
other devices via Bluetooth.public static final String FEATURE_BLUETOOTH_LE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device is capable of communicating with
other devices via Bluetooth Low Energy radio.public static final String FEATURE_CAMERA
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has a camera facing away
from the screen.public static final String FEATURE_CAMERA_AUTOFOCUS
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device's camera supports auto-focus.public static final String FEATURE_CAMERA_ANY
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has at least one camera pointing in
some direction, or can support an external camera being connected to it.public static final String FEATURE_CAMERA_EXTERNAL
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device can support having an external camera connected to it.
The external camera may not always be connected or available to applications to use.public static final String FEATURE_CAMERA_FLASH
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device's camera supports flash.public static final String FEATURE_CAMERA_FRONT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has a front facing camera.public static final String FEATURE_CAMERA_LEVEL_FULL
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
: At least one
of the cameras on the device supports the
full hardware
capability level.public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
: At least one
of the cameras on the device supports the
manual sensor
capability level.public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
: At least one
of the cameras on the device supports the
manual post-processing
capability level.public static final String FEATURE_CAMERA_CAPABILITY_RAW
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
: At least one
of the cameras on the device supports the
RAW
capability level.public static final String FEATURE_CONSUMER_IR
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device is capable of communicating with
consumer IR devices.public static final String FEATURE_LOCATION
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports one or more methods of
reporting current location.public static final String FEATURE_LOCATION_GPS
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has a Global Positioning System
receiver and can report precise location.public static final String FEATURE_LOCATION_NETWORK
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device can report location with coarse
accuracy using a network-based geolocation system.public static final String FEATURE_MICROPHONE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device can record audio via a
microphone.public static final String FEATURE_NFC
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device can communicate using Near-Field
Communications (NFC).@Deprecated public static final String FEATURE_NFC_HCE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports host-
based NFC card emulation.
TODO remove when depending apps have moved to new constant.public static final String FEATURE_NFC_HOST_CARD_EMULATION
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports host-
based NFC card emulation.public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports host-
based NFC-F card emulation.public static final String FEATURE_OPENGLES_EXTENSION_PACK
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports the OpenGL ES
Android Extension Pack.public static final String FEATURE_VULKAN_HARDWARE_LEVEL
getSystemAvailableFeatures()
and
hasSystemFeature(String, int)
: If this feature is supported, the Vulkan native API
will enumerate at least one VkPhysicalDevice
, and the feature version will indicate
what level of optional hardware features limits it supports.
Level 0 includes the base Vulkan requirements as well as:
VkPhysicalDeviceFeatures::textureCompressionETC2
Level 1 additionally includes:
VkPhysicalDeviceFeatures::fullDrawIndexUint32
VkPhysicalDeviceFeatures::imageCubeArray
VkPhysicalDeviceFeatures::independentBlend
VkPhysicalDeviceFeatures::geometryShader
VkPhysicalDeviceFeatures::tessellationShader
VkPhysicalDeviceFeatures::sampleRateShading
VkPhysicalDeviceFeatures::textureCompressionASTC_LDR
VkPhysicalDeviceFeatures::fragmentStoresAndAtomics
VkPhysicalDeviceFeatures::shaderImageGatherExtended
VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing
VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing
public static final String FEATURE_VULKAN_HARDWARE_VERSION
getSystemAvailableFeatures()
and
hasSystemFeature(String, int)
: The version of this feature indicates the highest
VkPhysicalDeviceProperties::apiVersion
supported by the physical devices that support
the hardware level indicated by FEATURE_VULKAN_HARDWARE_LEVEL
. The feature version
uses the same encoding as Vulkan version numbers:
public static final String FEATURE_SENSOR_ACCELEROMETER
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes an accelerometer.public static final String FEATURE_SENSOR_BAROMETER
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a barometer (air
pressure sensor.)public static final String FEATURE_SENSOR_COMPASS
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a magnetometer (compass).public static final String FEATURE_SENSOR_GYROSCOPE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a gyroscope.public static final String FEATURE_SENSOR_LIGHT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a light sensor.public static final String FEATURE_SENSOR_PROXIMITY
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a proximity sensor.public static final String FEATURE_SENSOR_STEP_COUNTER
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a hardware step counter.public static final String FEATURE_SENSOR_STEP_DETECTOR
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a hardware step detector.public static final String FEATURE_SENSOR_HEART_RATE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a heart rate monitor.public static final String FEATURE_SENSOR_HEART_RATE_ECG
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The heart rate sensor on this device is an Electrocardiogram.public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes a relative humidity sensor.public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device includes an ambient temperature sensor.public static final String FEATURE_HIFI_SENSORS
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports high fidelity sensor processing
capabilities.public static final String FEATURE_TELEPHONY
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has a telephony radio with data
communication support.public static final String FEATURE_TELEPHONY_CDMA
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has a CDMA telephony stack.public static final String FEATURE_TELEPHONY_GSM
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has a GSM telephony stack.public static final String FEATURE_USB_HOST
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports connecting to USB devices
as the USB host.public static final String FEATURE_USB_ACCESSORY
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports connecting to USB accessories.public static final String FEATURE_SIP
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The SIP API is enabled on the device.public static final String FEATURE_SIP_VOIP
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports SIP-based VOIP.public static final String FEATURE_CONNECTION_SERVICE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The Connection Service API is enabled on the device.public static final String FEATURE_TOUCHSCREEN
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device's display has a touch screen.public static final String FEATURE_TOUCHSCREEN_MULTITOUCH
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device's touch screen supports
multitouch sufficient for basic two-finger gesture detection.public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device's touch screen is capable of
tracking two or more fingers fully independently.public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device's touch screen is capable of
tracking a full hand of fingers fully independently -- that is, 5 or
more simultaneous independent pointers.public static final String FEATURE_FAKETOUCH
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device does not have a touch screen, but
does support touch emulation for basic events. For instance, the
device might use a mouse or remote control to drive a cursor, and
emulate basic touch pointer events like down, up, drag, etc. All
devices that support android.hardware.touchscreen or a sub-feature are
presumed to also support faketouch.public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device does not have a touch screen, but
does support touch emulation for basic events that supports distinct
tracking of two or more fingers. This is an extension of
FEATURE_FAKETOUCH
for input devices with this capability. Note
that unlike a distinct multitouch screen as defined by
FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT
, these kinds of input
devices will not actually provide full two-finger gestures since the
input is being transformed to cursor movement on the screen. That is,
single finger gestures will move a cursor; two-finger swipes will
result in single-finger touch events; other two-finger gestures will
result in the corresponding two-finger touch event.public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device does not have a touch screen, but
does support touch emulation for basic events that supports tracking
a hand of fingers (5 or more fingers) fully independently.
This is an extension of
FEATURE_FAKETOUCH
for input devices with this capability. Note
that unlike a multitouch screen as defined by
FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
, not all two finger
gestures can be detected due to the limitations described for
FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT
.public static final String FEATURE_FINGERPRINT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device has biometric hardware to detect a fingerprint.public static final String FEATURE_SCREEN_PORTRAIT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports portrait orientation
screens. For backwards compatibility, you can assume that if neither
this nor FEATURE_SCREEN_LANDSCAPE
is set then the device supports
both portrait and landscape.public static final String FEATURE_SCREEN_LANDSCAPE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports landscape orientation
screens. For backwards compatibility, you can assume that if neither
this nor FEATURE_SCREEN_PORTRAIT
is set then the device supports
both portrait and landscape.public static final String FEATURE_LIVE_WALLPAPER
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports live wallpapers.public static final String FEATURE_APP_WIDGETS
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports app widgets.public static final String FEATURE_VOICE_RECOGNIZERS
public static final String FEATURE_HOME_SCREEN
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports a home screen that is replaceable
by third party applications.public static final String FEATURE_INPUT_METHODS
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports adding new input methods implemented
with the InputMethodService
API.public static final String FEATURE_DEVICE_ADMIN
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports device policy enforcement via device admins.public static final String FEATURE_LEANBACK
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports leanback UI. This is
typically used in a living room television experience, but is a software
feature unlike FEATURE_TELEVISION
. Devices running with this
feature will use resources associated with the "television" UI mode.public static final String FEATURE_LEANBACK_ONLY
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports only leanback UI. Only
applications designed for this experience should be run, though this is
not enforced by the system.public static final String FEATURE_LIVE_TV
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports live TV and can display
contents from TV inputs implemented with the
TvInputService
API.public static final String FEATURE_WIFI
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports WiFi (802.11) networking.public static final String FEATURE_WIFI_DIRECT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports Wi-Fi Direct networking.public static final String FEATURE_WIFI_NAN
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports Wi-Fi Aware (NAN)
networking.public static final String FEATURE_AUTOMOTIVE
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: This is a device dedicated to showing UI
on a vehicle headunit. A headunit here is defined to be inside a
vehicle that may or may not be moving. A headunit uses either a
primary display in the center console and/or additional displays in
the instrument cluster or elsewhere in the vehicle. Headunit display(s)
have limited size and resolution. The user will likely be focused on
driving so limiting driver distraction is a primary concern. User input
can be a variety of hard buttons, touch, rotary controllers and even mouse-
like interfaces.@Deprecated public static final String FEATURE_TELEVISION
FEATURE_LEANBACK
instead.getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: This is a device dedicated to showing UI
on a television. Television here is defined to be a typical living
room television experience: displayed on a big screen, where the user
is sitting far away from it, and the dominant form of input will be
something like a DPAD, not through touch or mouse.public static final String FEATURE_WATCH
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: This is a device dedicated to showing UI
on a watch. A watch here is defined to be a device worn on the body, perhaps on
the wrist. The user is very close when interacting with the device.public static final String FEATURE_PRINTING
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device supports printing.public static final String FEATURE_BACKUP
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device can perform backup and restore operations on installed applications.public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: The device supports freeform window management.
Windows have title bars and can be moved and resized.public static final String FEATURE_PICTURE_IN_PICTURE
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device supports picture-in-picture multi-window mode.public static final String FEATURE_MANAGED_USERS
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device supports creating secondary users and managed profiles via
DevicePolicyManager
.public static final String FEATURE_MANAGED_PROFILES
public static final String FEATURE_VERIFIED_BOOT
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device supports verified boot.public static final String FEATURE_SECURELY_REMOVES_USERS
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device supports secure removal of users. When a user is deleted the data associated
with that user is securely deleted and no longer available.public static final String FEATURE_FILE_BASED_ENCRYPTION
public static final String FEATURE_WEBVIEW
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device has a full implementation of the android.webkit.* APIs. Devices
lacking this feature will not have a functioning WebView implementation.public static final String FEATURE_ETHERNET
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: This device supports ethernet.public static final String FEATURE_HDMI_CEC
getSystemAvailableFeatures()
and
hasSystemFeature(java.lang.String)
: This device supports HDMI-CEC.public static final String FEATURE_GAMEPAD
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device has all of the inputs necessary to be considered a compatible game controller, or
includes a compatible game controller in the box.public static final String FEATURE_MIDI
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device has a full implementation of the android.media.midi.* APIs.public static final String FEATURE_VR_MODE
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device implements an optimized mode for virtual reality (VR) applications that handles
stereoscopic rendering of notifications, and disables most monocular system UI components
while a VR application has user focus.
Devices declaring this feature must include an application implementing a
VrListenerService
that can be targeted by VR applications via
Activity.setVrModeEnabled(boolean, android.content.ComponentName)
.public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE
getSystemAvailableFeatures()
and hasSystemFeature(java.lang.String)
:
The device implements FEATURE_VR_MODE
but additionally meets extra CDD requirements
to provide a high-quality VR experience. In general, devices declaring this feature will
additionally:
Window.setSustainedPerformanceMode(boolean)
.FEATURE_HIFI_SENSORS
and have a low sensor latency.public static final String ACTION_CLEAN_EXTERNAL_STORAGE
public static final String EXTRA_VERIFICATION_URI
public static final String EXTRA_VERIFICATION_ID
verifyPendingInstall(int, int)
public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE
public static final String EXTRA_VERIFICATION_INSTALL_FLAGS
public static final String EXTRA_VERIFICATION_INSTALLER_UID
public static final String EXTRA_VERIFICATION_PACKAGE_NAME
public static final String EXTRA_VERIFICATION_RESULT
VERIFICATION_ALLOW
, or VERIFICATION_REJECT
.
Passed to package verifiers after a package is verified.public static final String EXTRA_VERIFICATION_VERSION_CODE
public static final String EXTRA_INTENT_FILTER_VERIFICATION_ID
verifyIntentFilter(int, int, java.util.List<java.lang.String>)
public static final String EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME
public static final String EXTRA_INTENT_FILTER_VERIFICATION_HOSTS
public static final String EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME
public static final String ACTION_REQUEST_PERMISSIONS
public static final String EXTRA_REQUEST_PERMISSIONS_NAMES
Type: String[]
public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS
Type: int[] of #PermissionResult
public static final String EXTRA_FAILURE_EXISTING_PACKAGE
PackageInstallObserver
in the 'extras' Bundle in case of
INSTALL_FAILED_DUPLICATE_PERMISSION
. This extra names the package which provides
the existing definition for the permission.public static final String EXTRA_FAILURE_EXISTING_PERMISSION
PackageInstallObserver
in the 'extras' Bundle in case of
INSTALL_FAILED_DUPLICATE_PERMISSION
. This extra names the permission that is
being redundantly defined by the package being installed.public static final int FLAG_PERMISSION_USER_SET
public static final int FLAG_PERMISSION_USER_FIXED
public static final int FLAG_PERMISSION_POLICY_FIXED
public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE
public static final int FLAG_PERMISSION_SYSTEM_FIXED
public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT
public static final int FLAG_PERMISSION_REVIEW_REQUIRED
public static final int MASK_PERMISSION_FLAGS
public static final String SYSTEM_SHARED_LIBRARY_SERVICES
#getVersionCode()
and avoid calling APIs added in later versions.public static final String SYSTEM_SHARED_LIBRARY_SHARED
Version.getVersionCode()
and avoid calling APIs added in later versions.public static final int NOTIFY_PACKAGE_USE_ACTIVITY
public static final int NOTIFY_PACKAGE_USE_SERVICE
public static final int NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE
public static final int NOTIFY_PACKAGE_USE_BROADCAST_RECEIVER
public static final int NOTIFY_PACKAGE_USE_CONTENT_PROVIDER
public static final int NOTIFY_PACKAGE_USE_BACKUP
public static final int NOTIFY_PACKAGE_USE_CROSS_PACKAGE
public static final int NOTIFY_PACKAGE_USE_INSTRUMENTATION
public static final int NOTIFY_PACKAGE_USE_REASONS_COUNT
public abstract PackageInfo getPackageInfo(String packageName, int flags) throws PackageManager.NameNotFoundException
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.flags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
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.GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
public abstract PackageInfo getPackageInfoAsUser(String packageName, int flags, int userId) throws PackageManager.NameNotFoundException
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.flags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
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.GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
public abstract String[] currentToCanonicalPackageNames(String[] names)
names
- Array of current names to be mapped.public abstract String[] canonicalToCurrentPackageNames(String[] names)
names
- Array of new names to be mapped.public abstract Intent getLaunchIntentForPackage(String packageName)
Intent.CATEGORY_INFO
, and next for a
main activity in the category Intent.CATEGORY_LAUNCHER
. Returns
null
if neither are found.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 abstract Intent getLeanbackLaunchIntentForPackage(String packageName)
Intent.CATEGORY_LEANBACK_LAUNCHER
, or
return null if no main leanback activities are found.packageName
- The name of the package to inspect.public abstract int[] getPackageGids(String packageName) throws PackageManager.NameNotFoundException
Note that the same package may have different GIDs under different
UserHandle
on the same device.
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 abstract int[] getPackageGids(String packageName, int flags) throws PackageManager.NameNotFoundException
Note that the same package may have different GIDs under different
UserHandle
on the same device.
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 abstract int getPackageUid(String packageName, int flags) throws PackageManager.NameNotFoundException
Note that the same package will have different UIDs under different
UserHandle
on the same device.
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 abstract int getPackageUidAsUser(String packageName, int userId) throws PackageManager.NameNotFoundException
Note that the same package will have different UIDs under different
UserHandle
on the same device.
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.userId
- 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 abstract int getPackageUidAsUser(String packageName, int flags, int userId) throws PackageManager.NameNotFoundException
Note that the same package will have different UIDs under different
UserHandle
on the same device.
packageName
- The full name (i.e. com.google.apps.contacts) of the
desired package.userId
- 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 abstract PermissionInfo getPermissionInfo(String name, int flags) throws PackageManager.NameNotFoundException
name
- The fully qualified name (i.e. com.google.permission.LOGIN)
of the permission you are interested in.flags
- Additional option flags. Use 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.GET_META_DATA
public abstract List<PermissionInfo> queryPermissionsByGroup(String group, int flags) throws PackageManager.NameNotFoundException
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 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.GET_META_DATA
public abstract PermissionGroupInfo getPermissionGroupInfo(String name, int flags) throws PackageManager.NameNotFoundException
name
- The fully qualified name (i.e. com.google.permission_group.APPS)
of the permission you are interested in.flags
- Additional option flags. Use 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.GET_META_DATA
public abstract List<PermissionGroupInfo> getAllPermissionGroups(int flags)
flags
- Additional option flags. Use GET_META_DATA
to
retrieve any meta-data associated with the permission group.PermissionGroupInfo
containing
information about all of the known permission groups.GET_META_DATA
public abstract ApplicationInfo getApplicationInfo(String packageName, int flags) throws PackageManager.NameNotFoundException
packageName
- The full name (i.e. com.google.apps.contacts) of an
application.flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_SYSTEM_ONLY
, 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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, int flags, int userId) throws PackageManager.NameNotFoundException
public abstract ActivityInfo getActivityInfo(ComponentName component, int flags) throws PackageManager.NameNotFoundException
component
- 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
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ActivityInfo getReceiverInfo(ComponentName component, int flags) throws PackageManager.NameNotFoundException
component
- 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
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ServiceInfo getServiceInfo(ComponentName component, int flags) throws PackageManager.NameNotFoundException
component
- 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
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ProviderInfo getProviderInfo(ComponentName component, int flags) throws PackageManager.NameNotFoundException
component
- 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
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<PackageInfo> getInstalledPackages(int flags)
flags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
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).GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<PackageInfo> getPackagesHoldingPermissions(String[] permissions, int flags)
flags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
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).GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<PackageInfo> getInstalledPackagesAsUser(int flags, int userId)
flags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
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).GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
public abstract int checkPermission(String permName, String pkgName)
permName
- The name of the permission you are checking for.pkgName
- The name of the package you are checking against.PERMISSION_GRANTED
,
PERMISSION_DENIED
public abstract boolean isPermissionRevokedByPolicy(String permName, String pkgName)
permName
- The name of the permission you are checking for.pkgName
- The name of the package you are checking against.public abstract String getPermissionControllerPackageName()
public abstract boolean addPermission(PermissionInfo info)
<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.
info
- Description of the permission to be added.SecurityException
- if you are not allowed to add the
given permission name.removePermission(String)
public abstract boolean addPermissionAsync(PermissionInfo info)
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.public abstract void removePermission(String name)
addPermission(PermissionInfo)
. The same ownership rules apply
-- you are only allowed to remove permissions that you are allowed
to add.name
- The name of the permission to remove.SecurityException
- if you are not allowed to remove the
given permission name.addPermission(PermissionInfo)
public abstract void grantRuntimePermission(String packageName, String permissionName, UserHandle user)
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.
packageName
- The package to which to grant the permission.permissionName
- The permission name to grant.user
- The user for which to grant the permission.revokeRuntimePermission(String, String, android.os.UserHandle)
,
PackageManager.PermissionFlags
public abstract void revokeRuntimePermission(String packageName, String permissionName, UserHandle user)
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.
packageName
- The package from which to revoke the permission.permissionName
- The permission name to revoke.user
- The user for which to revoke the permission.grantRuntimePermission(String, String, android.os.UserHandle)
,
PackageManager.PermissionFlags
public abstract int getPermissionFlags(String permissionName, String packageName, UserHandle user)
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 abstract void updatePermissionFlags(String permissionName, String packageName, int flagMask, int flagValues, UserHandle user)
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 abstract boolean shouldShowRequestPermissionRationale(String permission)
permission
- A permission your app wants to request.public Intent buildRequestPermissionsIntent(String[] permissions)
Intent
suitable for passing to
Activity.startActivityForResult(android.content.Intent, int)
which prompts the user to grant permissions to this application.NullPointerException
- if permissions
is null
or empty.public abstract int checkSignatures(String pkg1, String pkg2)
pkg1
- First package name whose signature will be compared.pkg2
- Second package name whose signature will be compared.SIGNATURE_MATCH
) if
all signatures match or < 0 if there is not a match (SIGNATURE_NO_MATCH
or SIGNATURE_UNKNOWN_PACKAGE
).checkSignatures(int, int)
,
SIGNATURE_MATCH
,
SIGNATURE_NO_MATCH
,
SIGNATURE_UNKNOWN_PACKAGE
public abstract int checkSignatures(int uid1, int uid2)
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.uid1
- First UID whose signature will be compared.uid2
- Second UID whose signature will be compared.SIGNATURE_MATCH
) if
all signatures match or < 0 if there is not a match (SIGNATURE_NO_MATCH
or SIGNATURE_UNKNOWN_PACKAGE
).checkSignatures(String, String)
,
SIGNATURE_MATCH
,
SIGNATURE_NO_MATCH
,
SIGNATURE_UNKNOWN_PACKAGE
public abstract String[] getPackagesForUid(int uid)
uid
- The user id for which you would like to retrieve the
associated packages.public abstract String getNameForUid(int uid)
uid
- The user id for which you would like to retrieve a name.public abstract int getUidForSharedUser(String sharedUserName) throws PackageManager.NameNotFoundException
sharedUserName
- The shared user name whose uid is to be retrieved.PackageManager.NameNotFoundException
- if a package with the given name cannot be
found on the system.public abstract List<ApplicationInfo> getInstalledApplications(int flags)
DONT_DELETE_DATA
(partially
installed apps with data directory) will be returned.flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_SYSTEM_ONLY
, 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).GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<EphemeralApplicationInfo> getEphemeralApplications()
public abstract Drawable getEphemeralApplicationIcon(String packageName)
packageName
- The app package name.public abstract boolean isEphemeralApplication()
setEphemeralCookie(byte[])
,
getEphemeralCookie()
,
getEphemeralCookieMaxSizeBytes()
public abstract int getEphemeralCookieMaxSizeBytes()
isEphemeralApplication()
,
setEphemeralCookie(byte[])
,
getEphemeralCookie()
public abstract byte[] getEphemeralCookie()
isEphemeralApplication()
,
setEphemeralCookie(byte[])
,
getEphemeralCookieMaxSizeBytes()
public abstract boolean setEphemeralCookie(byte[] cookie)
getEphemeralCookieMaxSizeBytes()
.cookie
- The cookie data.isEphemeralApplication()
,
getEphemeralCookieMaxSizeBytes()
,
getEphemeralCookie()
public abstract String[] getSystemSharedLibraryNames()
public abstract String getServicesSystemSharedLibraryPackageName()
public abstract String getSharedSystemSharedLibraryPackageName()
public abstract FeatureInfo[] getSystemAvailableFeatures()
public abstract boolean hasSystemFeature(String name)
getSystemAvailableFeatures()
. This tests for the
presence of any version of the given feature name; use
hasSystemFeature(String, int)
to check for a minimum version.public abstract boolean hasSystemFeature(String name, int version)
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.public abstract ResolveInfo resolveActivity(Intent intent, int flags)
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
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.
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId)
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
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.
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
.userId
- The user id.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentActivities(Intent intent, int flags)
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
. Or, set
MATCH_ALL
to prevent any filtering of the results.resolveActivity(android.content.Intent, int)
. If there are no matching activities, an
empty list is returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, int flags, int userId)
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
. Or, set
MATCH_ALL
to prevent any filtering of the results.resolveActivity(android.content.Intent, int)
. If there are no matching activities, an
empty list is returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentActivityOptions(ComponentName caller, Intent[] specifics, Intent intent, int flags)
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.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
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned. The most important is MATCH_DEFAULT_ONLY
,
to limit the resolution to only those activities that support
the Intent.CATEGORY_DEFAULT
.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags)
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, int flags, UserHandle userHandle)
intent
- The desired intent as per resolveActivity().flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.userHandle
- UserHandle of the user being queried.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, int flags, int userId)
@Deprecated public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags, int userId)
public abstract ResolveInfo resolveService(Intent intent, int flags)
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentServices(Intent intent, int flags)
intent
- The desired intent as per resolveService().flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.resolveService(android.content.Intent, int)
. If there are no matching services, an
empty list or null is returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, int flags, int userId)
intent
- The desired intent as per resolveService().flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.userId
- The user id.resolveService(android.content.Intent, int)
. If there are no matching services, an
empty list or null is returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentContentProvidersAsUser(Intent intent, int flags, int userId)
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.userId
- The user id.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags)
intent
- An intent containing all of the desired specification
(action, data, type, category, and/or component).flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
, MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
, MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.GET_META_DATA
,
GET_RESOLVED_FILTER
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DEFAULT_ONLY
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ProviderInfo resolveContentProvider(String name, int flags)
name
- The name of the provider to find.flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or MATCH_UNINSTALLED_PACKAGES
to modify the data
returned.ProviderInfo
object containing information about the
provider. If a provider was not found, returns null.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract ProviderInfo resolveContentProviderAsUser(String name, int flags, int userId)
name
- The name of the provider to find.flags
- Additional option flags. Use any combination of
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or 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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract List<ProviderInfo> queryContentProviders(String processName, int uid, int flags)
Note: unlike most other methods, an empty result set is indicated by a null return instead of an empty list.
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
GET_META_DATA
, GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
, MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
, MATCH_SYSTEM_ONLY
or 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.GET_META_DATA
,
GET_SHARED_LIBRARY_FILES
,
MATCH_ALL
,
MATCH_DEBUG_TRIAGED_MISSING
,
MATCH_DEFAULT_ONLY
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_DIRECT_BOOT_AWARE
,
MATCH_DIRECT_BOOT_UNAWARE
,
MATCH_SYSTEM_ONLY
,
MATCH_UNINSTALLED_PACKAGES
public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className, int flags) throws PackageManager.NameNotFoundException
className
- The full name (i.e.
com.google.apps.contacts.InstrumentList) of an
Instrumentation class.flags
- Additional option flags. Use any combination of
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.GET_META_DATA
public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage, int flags)
targetPackage
- If null, all instrumentation is returned; only the
instrumentation targeting this package name is
returned.flags
- Additional option flags. Use any combination of
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.GET_META_DATA
public abstract Drawable getDrawable(String packageName, @DrawableRes int resid, ApplicationInfo appInfo)
ComponentInfo
to implement retrieval of their associated
icon.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 abstract Drawable getActivityIcon(ComponentName activityName) throws PackageManager.NameNotFoundException
ComponentInfo.loadIcon()
to return its icon.
If the activity cannot be found, NameNotFoundException is thrown.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.getActivityIcon(Intent)
public abstract Drawable getActivityIcon(Intent intent) throws PackageManager.NameNotFoundException
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.getActivityIcon(ComponentName)
public abstract Drawable getActivityBanner(ComponentName activityName) throws PackageManager.NameNotFoundException
ComponentInfo.loadIcon()
to return its
banner. If the activity cannot be found, NameNotFoundException is thrown.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.getActivityBanner(Intent)
public abstract Drawable getActivityBanner(Intent intent) throws PackageManager.NameNotFoundException
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.getActivityBanner(ComponentName)
public abstract Drawable getDefaultActivityIcon()
public abstract Drawable getApplicationIcon(ApplicationInfo info)
info
- Information about application being queried.getApplicationIcon(String)
public abstract Drawable getApplicationIcon(String packageName) throws PackageManager.NameNotFoundException
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.getApplicationIcon(ApplicationInfo)
public abstract Drawable getApplicationBanner(ApplicationInfo info)
info
- Information about application being queried.getApplicationBanner(String)
public abstract Drawable getApplicationBanner(String packageName) throws PackageManager.NameNotFoundException
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.getApplicationBanner(ApplicationInfo)
public abstract Drawable getActivityLogo(ComponentName activityName) throws PackageManager.NameNotFoundException
ComponentInfo.loadLogo()
to return its
logo. If the activity cannot be found, NameNotFoundException is thrown.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.getActivityLogo(Intent)
public abstract Drawable getActivityLogo(Intent intent) throws PackageManager.NameNotFoundException
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.getActivityLogo(ComponentName)
public abstract Drawable getApplicationLogo(ApplicationInfo info)
info
- Information about application being queried.getApplicationLogo(String)
public abstract Drawable getApplicationLogo(String packageName) throws PackageManager.NameNotFoundException
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.getApplicationLogo(ApplicationInfo)
public abstract Drawable getManagedUserBadgedDrawable(Drawable drawable, Rect badgeLocation, int badgeDensity)
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.
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 abstract Drawable getUserBadgedIcon(Drawable icon, UserHandle user)
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.
icon
- The icon to badge.user
- The target user.public abstract Drawable getUserBadgedDrawableForDensity(Drawable drawable, UserHandle user, Rect badgeLocation, int badgeDensity)
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.
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 abstract Drawable getUserBadgeForDensity(UserHandle user, int density)
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 abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density)
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 abstract CharSequence getUserBadgedLabel(CharSequence label, UserHandle user)
label
- The label to change.user
- The target user.public abstract CharSequence getText(String packageName, @StringRes int resid, ApplicationInfo appInfo)
ComponentInfo
to implement retrieval of their associated
labels and other text.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 abstract XmlResourceParser getXml(String packageName, @XmlRes int resid, ApplicationInfo appInfo)
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 abstract CharSequence getApplicationLabel(ApplicationInfo info)
info
- The application to get the label of.public abstract Resources getResourcesForActivity(ComponentName activityName) throws PackageManager.NameNotFoundException
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.getResourcesForApplication(ApplicationInfo)
public abstract Resources getResourcesForApplication(ApplicationInfo app) throws PackageManager.NameNotFoundException
app
- Information about the desired application.PackageManager.NameNotFoundException
- Thrown if the resources for the given
application could not be loaded (most likely because it was uninstalled).public abstract Resources getResourcesForApplication(String appPackageName) throws PackageManager.NameNotFoundException
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.getResourcesForApplication(ApplicationInfo)
public abstract Resources getResourcesForApplicationAsUser(String appPackageName, int userId) throws PackageManager.NameNotFoundException
public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags)
archiveFilePath
- The path to the archive fileflags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
to modify the data returned.GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
@Deprecated public abstract void installPackage(Uri packageURI, IPackageInstallObserver observer, int flags, String installerPackageName)
PackageInstaller
public abstract int installExistingPackage(String packageName) throws PackageManager.NameNotFoundException
public abstract int installExistingPackageAsUser(String packageName, int userId) throws PackageManager.NameNotFoundException
public abstract void verifyPendingInstall(int id, int verificationCode)
package verification
broadcast
to respond to the package manager. The response must include
the verificationCode
which is one of
VERIFICATION_ALLOW
or
VERIFICATION_REJECT
.id
- pending package identifier as passed via the
EXTRA_VERIFICATION_ID
Intent extra.verificationCode
- either VERIFICATION_ALLOW
or VERIFICATION_REJECT
.SecurityException
- if the caller does not have the
PACKAGE_VERIFICATION_AGENT permission.public abstract void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay)
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
VERIFICATION_ALLOW
or
VERIFICATION_REJECT
.
This method may only be called once per package id. Additional calls
will have no effect.id
- pending package identifier as passed via the
EXTRA_VERIFICATION_ID
Intent extra.verificationCodeAtTimeout
- either
VERIFICATION_ALLOW
or
VERIFICATION_REJECT
. If
verificationCodeAtTimeout
is neither
VERIFICATION_ALLOW
or
VERIFICATION_REJECT
, then
verificationCodeAtTimeout
will default to
VERIFICATION_REJECT
.millisecondsToDelay
- the amount of time requested for the timeout.
Must be positive and less than
MAXIMUM_VERIFICATION_TIMEOUT
. If
millisecondsToDelay
is out of bounds,
millisecondsToDelay
will be set to the closest in
bounds value; namely, 0 or
MAXIMUM_VERIFICATION_TIMEOUT
.SecurityException
- if the caller does not have the
PACKAGE_VERIFICATION_AGENT permission.public abstract void verifyIntentFilter(int verificationId, int verificationCode, List<String> failedDomains)
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
INTENT_FILTER_VERIFICATION_SUCCESS
or
INTENT_FILTER_VERIFICATION_FAILURE
.verificationId
- pending package identifier as passed via the
EXTRA_VERIFICATION_ID
Intent extra.verificationCode
- either INTENT_FILTER_VERIFICATION_SUCCESS
or INTENT_FILTER_VERIFICATION_FAILURE
.failedDomains
- a list of failed domains if the verificationCode is
INTENT_FILTER_VERIFICATION_FAILURE
, otherwise null;SecurityException
- if the caller does not have the
INTENT_FILTER_VERIFICATION_AGENT permission.public abstract int getIntentVerificationStatusAsUser(String packageName, int userId)
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.packageName
- The package name of the Activity associated with the IntentFilter.userId
- The user id.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK
or
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS
or
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER
or
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED
public abstract boolean updateIntentVerificationStatusAsUser(String packageName, int status, int userId)
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.packageName
- The package name of the Activity associated with the IntentFilter.status
- The status to set to. This can be
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK
or
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS
or
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER
userId
- The user id.public abstract List<IntentFilterVerificationInfo> getIntentFilterVerifications(String packageName)
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 abstract List<IntentFilter> getAllIntentFilters(String packageName)
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.public abstract String getDefaultBrowserPackageNameAsUser(int userId)
userId
- The user id.public abstract boolean setDefaultBrowserPackageNameAsUser(String packageName, int userId)
packageName
- The package name of the default Browser.userId
- The user id.public abstract void setInstallerPackageName(String targetPackage, String installerPackageName)
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 abstract void deletePackage(String packageName, IPackageDeleteObserver observer, int flags)
android.Manifest.permission#DELETE_PACKAGES
permission, if the
named package cannot be found, or if the named package is a system
package.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 abstract void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, int flags, int userId)
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 abstract String getInstallerPackageName(String packageName)
packageName
- The name of the package to querypublic abstract void clearApplicationUserData(String packageName, IPackageDataObserver observer)
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 abstract void deleteApplicationCacheFiles(String packageName, IPackageDataObserver observer)
android.Manifest.permission#DELETE_CACHE_FILES
permission, if the
named package cannot be found, or if the named package is a "system package".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 abstract void deleteApplicationCacheFilesAsUser(String packageName, int userId, IPackageDataObserver observer)
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.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(long freeStorageSize, IPackageDataObserver observer)
freeStorageSize
- The number of bytes of storage to be
freed by the system. Say if freeStorageSize is XX,
and the current free storage is YY,
if XX is less than YY, just return. if not free XX-YY number
of bytes if possible.observer
- call back used to notify when
the operation is completedpublic abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, IPackageDataObserver observer)
public void freeStorage(long freeStorageSize, IntentSender pi)
freeStorageSize
- The number of bytes of storage to be
freed by the system. Say if freeStorageSize is XX,
and the current free storage is YY,
if XX is less than YY, just return. if not free XX-YY number
of bytes if possible.pi
- IntentSender call back used to
notify when the operation is completed.May be null
to indicate that no call back is desired.public abstract void freeStorage(String volumeUuid, long freeStorageSize, IntentSender pi)
public abstract void getPackageSizeInfoAsUser(String packageName, int userId, IPackageStatsObserver observer)
android.Manifest.permission#GET_PACKAGE_SIZE
permission.packageName
- The name of the package whose size information is to be retrieveduserId
- 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 void getPackageSizeInfo(String packageName, IPackageStatsObserver observer)
getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)
, but
returns the size for the calling user.@Deprecated public abstract void addPackageToPreferred(String packageName)
@Deprecated public abstract void removePackageFromPreferred(String packageName)
public abstract List<PackageInfo> getPreferredPackages(int flags)
flags
- Additional option flags. Use any combination of
GET_ACTIVITIES
, GET_CONFIGURATIONS
,
GET_GIDS
, GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
, GET_META_DATA
,
GET_PERMISSIONS
, GET_PROVIDERS
,
GET_RECEIVERS
, GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
, GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
, GET_UNINSTALLED_PACKAGES
,
MATCH_DISABLED_COMPONENTS
, MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
to modify the data returned.GET_ACTIVITIES
,
GET_CONFIGURATIONS
,
GET_GIDS
,
GET_INSTRUMENTATION
,
GET_INTENT_FILTERS
,
GET_META_DATA
,
GET_PERMISSIONS
,
GET_PROVIDERS
,
GET_RECEIVERS
,
GET_SERVICES
,
GET_SHARED_LIBRARY_FILES
,
GET_SIGNATURES
,
GET_URI_PERMISSION_PATTERNS
,
MATCH_DISABLED_COMPONENTS
,
MATCH_DISABLED_UNTIL_USED_COMPONENTS
,
MATCH_UNINSTALLED_PACKAGES
@Deprecated public abstract void addPreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity)
Context.startActivity()
finds
multiple matching activities and also matches the given filter.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 addPreferredActivityAsUser(IntentFilter filter, int match, ComponentName[] set, ComponentName activity, int userId)
addPreferredActivity(IntentFilter, int,
ComponentName[], ComponentName)
, but with a specific userId to apply the preference
to.@Deprecated public abstract void replacePreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity)
Context.startActivity()
finds
multiple matching activities and also matches the given filter.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.@Deprecated public void replacePreferredActivityAsUser(IntentFilter filter, int match, ComponentName[] set, ComponentName activity, int userId)
public abstract void clearPackagePreferredActivities(String packageName)
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).packageName
- The name of the package whose preferred activity
mappings are to be removed.public abstract int getPreferredActivities(List<IntentFilter> outFilters, List<ComponentName> outActivities, String packageName)
addPreferredActivity(android.content.IntentFilter, int, android.content.ComponentName[], android.content.ComponentName)
, that are
currently registered with the system.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 abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities)
public abstract void setComponentEnabledSetting(ComponentName componentName, int newState, int flags)
componentName
- The component to enablenewState
- The new enabled state for the component. The legal values for this state
are:
COMPONENT_ENABLED_STATE_ENABLED
,
COMPONENT_ENABLED_STATE_DISABLED
and
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: DONT_KILL_APP
or 0.public abstract int getComponentEnabledSetting(ComponentName componentName)
setComponentEnabledSetting(ComponentName, int, int)
; in most
cases this value will be COMPONENT_ENABLED_STATE_DEFAULT
since
the value originally specified in the manifest has not been modified.componentName
- The component to retrieve.COMPONENT_ENABLED_STATE_ENABLED
,
COMPONENT_ENABLED_STATE_DISABLED
, or
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 abstract void setApplicationEnabledSetting(String packageName, int newState, int flags)
setComponentEnabledSetting(android.content.ComponentName, int, int)
for any of the application's components.packageName
- The package name of the application to enablenewState
- The new enabled state for the component. The legal values for this state
are:
COMPONENT_ENABLED_STATE_ENABLED
,
COMPONENT_ENABLED_STATE_DISABLED
and
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: DONT_KILL_APP
or 0.public abstract int getApplicationEnabledSetting(String packageName)
setApplicationEnabledSetting(String, int, int)
; in most
cases this value will be COMPONENT_ENABLED_STATE_DEFAULT
since
the value originally specified in the manifest has not been modified.packageName
- The package name of the application to retrieve.COMPONENT_ENABLED_STATE_ENABLED
,
COMPONENT_ENABLED_STATE_DISABLED
, or
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
.IllegalArgumentException
- if the named package does not exist.public abstract void flushPackageRestrictionsAsUser(int userId)
userId
- Ther userId of the user whose restrictions are to be flushed.public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, UserHandle userHandle)
installExistingPackage(String)
public abstract boolean getApplicationHiddenSettingAsUser(String packageName, UserHandle userHandle)
public abstract boolean isSafeMode()
public abstract void addOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
listener
- The listener to add.public abstract void removeOnPermissionsChangeListener(PackageManager.OnPermissionsChangedListener listener)
listener
- The listener to remove.public abstract KeySet getKeySetByAlias(String packageName, String alias)
KeySet
associated with the String alias for this
application.alias
- The alias for a given KeySet
as defined in the
application's AndroidManifest.xml.public abstract KeySet getSigningKeySet(String packageName)
KeySet
for this application.public abstract boolean isSignedBy(String packageName, KeySet ks)
KeySet
ks. This will return true if
the package has been signed by additional keys (a superset) as well.
Compare to isSignedByExactly(String packageName, KeySet ks)
.public abstract boolean isSignedByExactly(String packageName, KeySet ks)
KeySet
ks. Compare to
isSignedBy(String packageName, KeySet ks)
.public abstract String[] setPackagesSuspendedAsUser(String[] packageNames, boolean suspended, int userId)
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.
packageNames
- The names of the packages to set the suspended status.suspended
- If set to true
than the packages will be suspended, if set to
false
the packages will be unsuspended.userId
- The user id.public abstract boolean isPackageSuspendedForUser(String packageName, int userId)
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 static boolean isMoveStatusFinished(int status)
public abstract int getMoveStatus(int moveId)
public abstract void registerMoveCallback(PackageManager.MoveCallback callback, Handler handler)
public abstract void unregisterMoveCallback(PackageManager.MoveCallback callback)
public abstract int movePackage(String packageName, VolumeInfo vol)
public abstract VolumeInfo getPackageCurrentVolume(ApplicationInfo app)
public abstract List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app)
public abstract int movePrimaryStorage(VolumeInfo vol)
public abstract VolumeInfo getPrimaryStorageCurrentVolume()
public abstract List<VolumeInfo> getPrimaryStorageCandidateVolumes()
public abstract VerifierDeviceIdentity getVerifierDeviceIdentity()
public abstract boolean isUpgrade()
public abstract PackageInstaller getPackageInstaller()
public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, int targetUserId, int flags)
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.filter
- The IntentFilter
the intent has to matchsourceUserId
- The source user id.targetUserId
- The target user id.flags
- The possible values are SKIP_CURRENT_PROFILE
and
ONLY_IF_NO_MATCH_FOUND
.public abstract void clearCrossProfileIntentFilters(int sourceUserId)
CrossProfileIntentFilter
s which have the specified user
as their source, and have been set by the app calling this method.sourceUserId
- The source user id.public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo)
public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo)
public abstract boolean isPackageAvailable(String packageName)
public static String installStatusToString(int status)
public static int installStatusToPublicStatus(int status)
public static String deleteStatusToString(int status)
public static int deleteStatusToPublicStatus(int status)
public static String permissionFlagToString(int flag)