ApplicationInfo | Android Developers
source link: https://developer.android.com/reference/android/content/pm/ApplicationInfo
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
- Android API Reference
- Overview
- Android Platform
- Packages
- API level
- Class Index
- Package Index
- android
- android.accessibilityservice
- android.accounts
- android.animation
- android.annotation
- android.app
- android.app.admin
- android.app.appsearch
- android.app.appsearch.exceptions
- android.app.assist
- android.app.backup
- android.app.blob
- android.app.job
- android.app.people
- android.app.role
- android.app.slice
- android.app.usage
- android.appwidget
- android.bluetooth
- android.bluetooth.le
- android.companion
- android.content
- android.content.pm
- android.content.pm.verify.domain
- android.content.res
- android.content.res.loader
- android.database
- android.database.sqlite
- android.drm
- android.gesture
- android.graphics
- android.graphics.drawable
- android.graphics.drawable.shapes
- android.graphics.fonts
- android.graphics.pdf
- android.graphics.text
- android.hardware
- android.hardware.biometrics
- android.hardware.camera2
- android.hardware.camera2.params
- android.hardware.display
- android.hardware.fingerprint
- android.hardware.input
- android.hardware.lights
- android.hardware.usb
- android.icu.lang
- android.icu.math
- android.icu.number
- android.icu.text
- android.icu.util
- android.inputmethodservice
- android.location
- android.location.provider
- android.media
- android.media.audiofx
- android.media.browse
- android.media.effect
- android.media.metrics
- android.media.midi
- android.media.projection
- android.media.session
- android.media.tv
- android.mtp
- android.net
- android.net.eap
- android.net.http
- android.net.ipsec.ike
- android.net.ipsec.ike.exceptions
- android.net.nsd
- android.net.rtp
- android.net.sip
- android.net.ssl
- android.net.vcn
- android.net.wifi
- android.net.wifi.aware
- android.net.wifi.hotspot2
- android.net.wifi.hotspot2.omadm
- android.net.wifi.hotspot2.pps
- android.net.wifi.p2p
- android.net.wifi.p2p.nsd
- android.net.wifi.rtt
- android.nfc
- android.nfc.cardemulation
- android.nfc.tech
- android.opengl
- android.os
- android.os.health
- android.os.storage
- android.os.strictmode
- android.preference
- android.print
- android.print.pdf
- android.printservice
- android.provider
- android.renderscript
- android.sax
- android.se.omapi
- android.security
- android.security.identity
- android.security.keystore
- android.service.autofill
- android.service.carrier
- android.service.chooser
- android.service.controls
- android.service.controls.actions
- android.service.controls.templates
- android.service.dataloader
- android.service.dreams
- android.service.media
- android.service.notification
- android.service.quickaccesswallet
- android.service.quicksettings
- android.service.restrictions
- android.service.textservice
- android.service.voice
- android.service.vr
- android.service.wallpaper
- android.speech
- android.speech.tts
- android.system
- android.telecom
- android.telephony
- android.telephony.cdma
- android.telephony.data
- android.telephony.emergency
- android.telephony.euicc
- android.telephony.gsm
- android.telephony.ims
- android.telephony.ims.feature
- android.telephony.mbms
- android.test
- android.test.mock
- android.test.suitebuilder
- android.test.suitebuilder.annotation
- android.text
- android.text.format
- android.text.method
- android.text.style
- android.text.util
- android.transition
- android.util
- android.util.proto
- android.view
- android.view.accessibility
- android.view.animation
- android.view.autofill
- android.view.contentcapture
- android.view.displayhash
- android.view.inputmethod
- android.view.inspector
- android.view.textclassifier
- android.view.textservice
- android.view.translation
- android.webkit
- android.widget
- android.widget.inline
- android.window
- com.google.android.collect
- com.google.android.gles_jni
- com.google.android.util
- dalvik.annotation
- dalvik.bytecode
- dalvik.system
- java.awt.font
- java.beans
- java.io
- java.lang
- java.lang.annotation
- java.lang.invoke
- java.lang.ref
- java.lang.reflect
- java.math
- java.net
- java.nio
- java.nio.channels
- java.nio.channels.spi
- java.nio.charset
- java.nio.charset.spi
- java.nio.file
- java.nio.file.attribute
- java.nio.file.spi
- java.security
- java.security.acl
- java.security.cert
- java.security.interfaces
- java.security.spec
- java.sql
- java.text
- java.time
- java.time.chrono
- java.time.format
- java.time.temporal
- java.time.zone
- java.util
- java.util.concurrent
- java.util.concurrent.atomic
- java.util.concurrent.locks
- java.util.function
- java.util.jar
- java.util.logging
- java.util.prefs
- java.util.regex
- java.util.stream
- java.util.zip
- javax.crypto
- javax.crypto.interfaces
- javax.crypto.spec
- javax.microedition.khronos.egl
- javax.microedition.khronos.opengles
- javax.net
- javax.net.ssl
- javax.security.auth
- javax.security.auth.callback
- javax.security.auth.login
- javax.security.auth.x500
- javax.security.cert
- javax.sql
- javax.xml
- javax.xml.datatype
- javax.xml.namespace
- javax.xml.parsers
- javax.xml.transform
- javax.xml.transform.dom
- javax.xml.transform.sax
- javax.xml.transform.stream
- javax.xml.validation
- javax.xml.xpath
- junit.framework
- junit.runner
- org.apache.http.conn
- org.apache.http.conn.scheme
- org.apache.http.conn.ssl
- org.apache.http.params
- org.json
- org.w3c.dom
- org.w3c.dom.ls
- org.xml.sax
- org.xml.sax.ext
- org.xml.sax.helpers
- org.xmlpull.v1
- org.xmlpull.v1.sax2
ApplicationInfo
public
class
ApplicationInfo
extends PackageItemInfo
implements
Parcelable
Information you can retrieve about a particular application. This corresponds to information collected from the AndroidManifest.xml's <application> tag.
Summary
Constants
int
CATEGORY_ACCESSIBILITY
Category for apps which are primarily accessibility apps, such as screen-readers.
int
CATEGORY_AUDIO
Category for apps which primarily work with audio or music, such as music players.
int
CATEGORY_GAME
Category for apps which are primarily games.
int
CATEGORY_IMAGE
Category for apps which primarily work with images or photos, such as camera or gallery apps.
int
CATEGORY_MAPS
Category for apps which are primarily maps apps, such as navigation apps.
int
CATEGORY_NEWS
Category for apps which are primarily news apps, such as newspapers, magazines, or sports apps.
int
CATEGORY_PRODUCTIVITY
Category for apps which are primarily productivity apps, such as cloud storage or workplace apps.
int
CATEGORY_SOCIAL
Category for apps which are primarily social apps, such as messaging, communication, email, or social network apps.
int
CATEGORY_UNDEFINED
Value when category is undefined.
int
CATEGORY_VIDEO
Category for apps which primarily work with video or movies, such as streaming video apps.
int
FLAG_ALLOW_BACKUP
Value for flags
: set to false
if the application does not wish
to permit any OS-driven backups of its data; true
otherwise.
int
FLAG_ALLOW_CLEAR_USER_DATA
Value for flags
: default value for the corresponding ActivityInfo flag.
int
FLAG_ALLOW_TASK_REPARENTING
Value for flags
: default value for the corresponding ActivityInfo flag.
int
FLAG_DEBUGGABLE
Value for flags
: set to true if this application would like to
allow debugging of its
code, even when installed on a non-development system.
int
FLAG_EXTERNAL_STORAGE
Value for flags
: Set to true if the application is
currently installed on external/removable/unprotected storage.
int
FLAG_EXTRACT_NATIVE_LIBS
When set installer extracts native libs from .apk files.
int
FLAG_FACTORY_TEST
Value for flags
: set to true if this application holds the
Manifest.permission.FACTORY_TEST
permission and the
device is running in factory test mode.
int
FLAG_FULL_BACKUP_ONLY
Value for flags
: true
if the application asks that only
full-data streaming backups of its data be performed even though it defines
a BackupAgent
, which normally
indicates that the app will manage its backed-up data via incremental
key/value updates.
int
FLAG_HARDWARE_ACCELERATED
Value for flags
: true
when the application's rendering
should be hardware accelerated.
int
FLAG_HAS_CODE
Value for flags
: set to true if this application has code
associated with it.
int
FLAG_INSTALLED
Value for flags
: true if the application is currently
installed for the calling user.
int
FLAG_IS_DATA_ONLY
Value for flags
: true if the application only has its
data installed; the application package itself does not currently
exist on the device.
int
FLAG_IS_GAME
This constant was deprecated
in API level 26.
use CATEGORY_GAME
instead.
int
FLAG_KILL_AFTER_RESTORE
Value for flags
: set to false
if the application must be kept
in memory following a full-system restore operation; true
otherwise.
int
FLAG_LARGE_HEAP
Value for flags
: true when the application has requested a
large heap for its processes.
int
FLAG_MULTIARCH
Value for flags
: true if code from this application will need to be
loaded into other applications' processes.
int
FLAG_PERSISTENT
Value for flags
: set to true if this application is persistent.
int
FLAG_RESIZEABLE_FOR_SCREENS
Value for flags
: true when the application knows how to adjust
its UI for different screen sizes.
int
FLAG_RESTORE_ANY_VERSION
Value for flags
: Set to true
if the application's backup
agent claims to be able to handle restore data even "from the future,"
i.e.
int
FLAG_STOPPED
Value for flags
: true if this application's package is in
the stopped state.
int
FLAG_SUPPORTS_LARGE_SCREENS
Value for flags
: true when the application's window can be
increased in size for larger screens.
int
FLAG_SUPPORTS_NORMAL_SCREENS
Value for flags
: true when the application's window can be
displayed on normal screens.
int
FLAG_SUPPORTS_RTL
Value for flags
: true when the application is willing to support
RTL (right to left).
int
FLAG_SUPPORTS_SCREEN_DENSITIES
This constant was deprecated in API level 30. Set by default when targeting API 4 or higher and apps should not set this to false.
int
FLAG_SUPPORTS_SMALL_SCREENS
Value for flags
: true when the application's window can be
reduced in size for smaller screens.
int
FLAG_SUPPORTS_XLARGE_SCREENS
Value for flags
: true when the application's window can be
increased in size for extra large screens.
int
FLAG_SUSPENDED
Value for flags
: true if this application's package is in
the suspended state.
int
FLAG_SYSTEM
Value for flags
: if set, this application is installed in the device's system image.
int
FLAG_TEST_ONLY
Value for flags
: this is set if the application has specified
android:testOnly
to be true.
int
FLAG_UPDATED_SYSTEM_APP
Value for flags
: this is set if this application has been
installed as an update to a built-in system application.
int
FLAG_USES_CLEARTEXT_TRAFFIC
Value for flags
: true
if the application may use cleartext network traffic
(e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP
without STARTTLS or TLS).
int
FLAG_VM_SAFE_MODE
Value for flags
: set to true if this application would like to
request the VM to operate under the safe mode.
int
GWP_ASAN_ALWAYS
Always enable GWP-ASan in this application or process.
int
GWP_ASAN_DEFAULT
Default (unspecified) setting of GWP-ASan.
int
GWP_ASAN_NEVER
Never enable GWP-ASan in this application or process.
int
MEMTAG_ASYNC
Enable Memtag in Async mode in this application or process.
int
MEMTAG_DEFAULT
Default (unspecified) setting of Memtag.
int
MEMTAG_OFF
Do not enable Memtag in this application or process.
int
MEMTAG_SYNC
Enable Memtag in Sync mode in this application or process.
int
ZEROINIT_DEFAULT
Default (unspecified) setting of nativeHeapZeroInitialized.
int
ZEROINIT_DISABLED
Disable zero-initialization of the native heap in this application or process.
int
ZEROINIT_ENABLED
Enable zero-initialization of the native heap in this application or process.
Inherited constants
From interfaceandroid.os.Parcelable
Fields
public
static
final
Creator<ApplicationInfo>
CREATOR
public
String
appComponentFactory
The factory of this package, as specified by the <manifest>
tag's R.styleable.AndroidManifestApplication_appComponentFactory
attribute.
public
String
backupAgentName
Class implementing the Application's backup functionality.
public
int
category
The category of this app.
public
String
className
Class implementing the Application object.
public
int
compatibleWidthLimitDp
The maximum smallest screen width the application is designed for.
public
int
compileSdkVersion
The user-visible SDK version (ex.
public
String
compileSdkVersionCodename
The development codename (ex.
public
String
dataDir
Full path to the default directory assigned to the package for its persistent data.
public
int
descriptionRes
A style resource identifier (in the package's resources) of the description of an application.
public
String
deviceProtectedDataDir
Full path to the device-protected directory assigned to the package for its persistent data.
public
boolean
enabled
When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.
public
int
flags
Flags associated with the application.
public
int
largestWidthLimitDp
The maximum smallest screen width the application will work on.
public
String
manageSpaceActivityName
Class implementing the Application's manage space functionality.
public
int
minSdkVersion
The minimum SDK version this application can run on.
public
String
nativeLibraryDir
Full path to the directory where native JNI libraries are stored.
public
String
permission
Optional name of a permission required to be able to access this application's components.
public
String
processName
The name of the process this application should run in.
public
String
publicSourceDir
Full path to the publicly available parts of sourceDir
,
including resources and manifest.
public
int
requiresSmallestWidthDp
The required smallest screen width the application can run on.
public
String[]
sharedLibraryFiles
Paths to all shared libraries this application is linked against.
public
String
sourceDir
Full path to the base APK for this application.
public
String[]
splitNames
The names of all installed split APKs, ordered lexicographically.
public
String[]
splitPublicSourceDirs
Full path to the publicly available parts of splitSourceDirs
,
including resources and manifest.
public
String[]
splitSourceDirs
Full paths to zero or more split APKs, indexed by the same order as splitNames
.
public
UUID
storageUuid
UUID of the storage volume on which this application is being hosted.
public
int
targetSdkVersion
The minimum SDK version this application targets.
public
String
taskAffinity
Default task affinity of all activities in this application.
public
int
theme
A style resource identifier (in the package's resources) of the default visual theme of the application.
public
int
uiOptions
The default extra UI options for activities in this application.
public
int
uid
The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).
Inherited fields
From classandroid.content.pm.PackageItemInfo
Public methods
int
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
void
dump(Printer pw, String prefix)
static
CharSequence
getCategoryTitle(Context context, int category)
Return a concise, localized title for the given
ApplicationInfo#category
value, or null
for unknown
values such as CATEGORY_UNDEFINED
.
int
getGwpAsanMode()
int
getMemtagMode()
Returns whether the application has requested Memtag to be enabled, disabled, or left unspecified.
int
getNativeHeapZeroInitialized()
Returns whether the application has requested automatic zero-initialization of native heap memory allocations to be enabled or disabled.
boolean
isProfileableByShell()
Returns whether or not this application can be profiled by the shell user, even when running on a device that is running in user mode.
boolean
isResourceOverlay()
Returns true if the package has declared in its manifest that it is a runtime resource overlay.
boolean
isVirtualPreload()
Returns whether or not this application was installed as a virtual preload.
CharSequence
loadDescription(PackageManager pm)
Retrieve the textual description of the application.
String
toString()
Returns a string representation of the object.
void
writeToParcel(Parcel dest, int parcelableFlags)
Constants
CATEGORY_ACCESSIBILITY
public static final int CATEGORY_ACCESSIBILITY
Category for apps which are primarily accessibility apps, such as screen-readers.
See also:
Constant Value: 8 (0x00000008)
CATEGORY_AUDIO
public static final int CATEGORY_AUDIO
Category for apps which primarily work with audio or music, such as music players.
See also:
Constant Value: 1 (0x00000001)
CATEGORY_GAME
public static final int CATEGORY_GAME
Category for apps which are primarily games.
See also:
Constant Value: 0 (0x00000000)
CATEGORY_IMAGE
public static final int CATEGORY_IMAGE
Category for apps which primarily work with images or photos, such as camera or gallery apps.
See also:
Constant Value: 3 (0x00000003)
CATEGORY_MAPS
public static final int CATEGORY_MAPS
Category for apps which are primarily maps apps, such as navigation apps.
See also:
Constant Value: 6 (0x00000006)
CATEGORY_NEWS
public static final int CATEGORY_NEWS
Category for apps which are primarily news apps, such as newspapers, magazines, or sports apps.
See also:
Constant Value: 5 (0x00000005)
CATEGORY_PRODUCTIVITY
public static final int CATEGORY_PRODUCTIVITY
Category for apps which are primarily productivity apps, such as cloud storage or workplace apps.
See also:
Constant Value: 7 (0x00000007)
CATEGORY_SOCIAL
public static final int CATEGORY_SOCIAL
Category for apps which are primarily social apps, such as messaging, communication, email, or social network apps.
See also:
Constant Value: 4 (0x00000004)
CATEGORY_UNDEFINED
public static final int CATEGORY_UNDEFINED
Value when category is undefined.
See also:
Constant Value: -1 (0xffffffff)
CATEGORY_VIDEO
public static final int CATEGORY_VIDEO
Category for apps which primarily work with video or movies, such as streaming video apps.
See also:
Constant Value: 2 (0x00000002)
FLAG_ALLOW_BACKUP
public static final int FLAG_ALLOW_BACKUP
Value for flags
: set to false
if the application does not wish
to permit any OS-driven backups of its data; true
otherwise.
Comes from the
android:allowBackup
attribute of the <application> tag.
Constant Value: 32768 (0x00008000)
FLAG_ALLOW_CLEAR_USER_DATA
public static final int FLAG_ALLOW_CLEAR_USER_DATA
Value for flags
: default value for the corresponding ActivityInfo flag.
Comes from android:allowClearUserData
of the <application> tag.
Constant Value: 64 (0x00000040)
FLAG_ALLOW_TASK_REPARENTING
public static final int FLAG_ALLOW_TASK_REPARENTING
Value for flags
: default value for the corresponding ActivityInfo flag.
Comes from android:allowTaskReparenting
of the <application> tag.
Constant Value: 32 (0x00000020)
FLAG_DEBUGGABLE
public static final int FLAG_DEBUGGABLE
Value for flags
: set to true if this application would like to
allow debugging of its
code, even when installed on a non-development system. Comes
from android:debuggable
of the <application> tag.
Constant Value: 2 (0x00000002)
FLAG_EXTERNAL_STORAGE
public static final int FLAG_EXTERNAL_STORAGE
Value for flags
: Set to true if the application is
currently installed on external/removable/unprotected storage. Such
applications may not be available if their storage is not currently
mounted. When the storage it is on is not available, it will look like
the application has been uninstalled (its .apk is no longer available)
but its persistent data is not removed.
Constant Value: 262144 (0x00040000)
FLAG_EXTRACT_NATIVE_LIBS
public static final int FLAG_EXTRACT_NATIVE_LIBS
When set installer extracts native libs from .apk files.
Constant Value: 268435456 (0x10000000)
FLAG_FACTORY_TEST
public static final int FLAG_FACTORY_TEST
Value for flags
: set to true if this application holds the
Manifest.permission.FACTORY_TEST
permission and the
device is running in factory test mode.
Constant Value: 16 (0x00000010)
FLAG_FULL_BACKUP_ONLY
public static final int FLAG_FULL_BACKUP_ONLY
Value for flags
: true
if the application asks that only
full-data streaming backups of its data be performed even though it defines
a BackupAgent
, which normally
indicates that the app will manage its backed-up data via incremental
key/value updates.
Constant Value: 67108864 (0x04000000)
FLAG_HARDWARE_ACCELERATED
public static final int FLAG_HARDWARE_ACCELERATED
Value for flags
: true
when the application's rendering
should be hardware accelerated.
Constant Value: 536870912 (0x20000000)
FLAG_HAS_CODE
public static final int FLAG_HAS_CODE
Value for flags
: set to true if this application has code
associated with it. Comes
from android:hasCode
of the <application> tag.
Constant Value: 4 (0x00000004)
FLAG_INSTALLED
public static final int FLAG_INSTALLED
Value for flags
: true if the application is currently
installed for the calling user.
Constant Value: 8388608 (0x00800000)
FLAG_IS_DATA_ONLY
public static final int FLAG_IS_DATA_ONLY
Value for flags
: true if the application only has its
data installed; the application package itself does not currently
exist on the device.
Constant Value: 16777216 (0x01000000)
FLAG_IS_GAME
public static final int FLAG_IS_GAME
This constant was deprecated
in API level 26.
use CATEGORY_GAME
instead.
Value for flags
: true if the application was declared to be a
game, or false if it is a non-game application.
Constant Value: 33554432 (0x02000000)
FLAG_KILL_AFTER_RESTORE
public static final int FLAG_KILL_AFTER_RESTORE
Value for flags
: set to false
if the application must be kept
in memory following a full-system restore operation; true
otherwise.
Ordinarily, during a full system restore operation each application is shut down
following execution of its agent's onRestore() method. Setting this attribute to
false
prevents this. Most applications will not need to set this attribute.
If
android:allowBackup
is set to false
or no
android:backupAgent
is specified, this flag will be ignored.
Comes from the
android:killAfterRestore
attribute of the <application> tag.
Constant Value: 65536 (0x00010000)
FLAG_LARGE_HEAP
public static final int FLAG_LARGE_HEAP
Value for flags
: true when the application has requested a
large heap for its processes. Corresponds to
android:largeHeap
.
Constant Value: 1048576 (0x00100000)
FLAG_MULTIARCH
public static final int FLAG_MULTIARCH
Value for flags
: true if code from this application will need to be
loaded into other applications' processes. On devices that support multiple
instruction sets, this implies the code might be loaded into a process that's
using any of the devices supported instruction sets.
The system might treat such applications specially, for eg., by extracting the application's native libraries for all supported instruction sets or by compiling the application's dex code for all supported instruction sets.
Constant Value: -2147483648 (0x80000000)
FLAG_PERSISTENT
public static final int FLAG_PERSISTENT
Value for flags
: set to true if this application is persistent.
Comes from android:persistent
of the <application> tag.
Constant Value: 8 (0x00000008)
FLAG_RESIZEABLE_FOR_SCREENS
public static final int FLAG_RESIZEABLE_FOR_SCREENS
Value for flags
: true when the application knows how to adjust
its UI for different screen sizes. Corresponds to
android:resizeable
.
Constant Value: 4096 (0x00001000)
FLAG_RESTORE_ANY_VERSION
public static final int FLAG_RESTORE_ANY_VERSION
Value for flags
: Set to true
if the application's backup
agent claims to be able to handle restore data even "from the future,"
i.e. from versions of the application with a versionCode greater than
the one currently installed on the device. Use with caution! By default
this attribute is false
and the Backup Manager will ensure that data
from "future" versions of the application are never supplied during a restore operation.
If
android:allowBackup
is set to false
or no
android:backupAgent
is specified, this flag will be ignored.
Comes from the
android:restoreAnyVersion
attribute of the <application> tag.
Constant Value: 131072 (0x00020000)
FLAG_STOPPED
public static final int FLAG_STOPPED
Value for flags
: true if this application's package is in
the stopped state.
Constant Value: 2097152 (0x00200000)
FLAG_SUPPORTS_LARGE_SCREENS
public static final int FLAG_SUPPORTS_LARGE_SCREENS
Value for flags
: true when the application's window can be
increased in size for larger screens. Corresponds to
android:largeScreens
.
Constant Value: 2048 (0x00000800)
FLAG_SUPPORTS_NORMAL_SCREENS
public static final int FLAG_SUPPORTS_NORMAL_SCREENS
Value for flags
: true when the application's window can be
displayed on normal screens. Corresponds to
android:normalScreens
.
Constant Value: 1024 (0x00000400)
FLAG_SUPPORTS_RTL
public static final int FLAG_SUPPORTS_RTL
Value for flags
: true when the application is willing to support
RTL (right to left). All activities will inherit this value.
Set from the R.attr.supportsRtl
attribute in the
activity's manifest.
Default value is false (no support for RTL).
Constant Value: 4194304 (0x00400000)
FLAG_SUPPORTS_SCREEN_DENSITIES
public static final int FLAG_SUPPORTS_SCREEN_DENSITIES
This constant was deprecated
in API level 30.
Set by default when targeting API 4 or higher and apps
should not set this to false.
Value for flags
: true when the application knows how to
accommodate different screen densities. Corresponds to
android:anyDensity
.
Constant Value: 8192 (0x00002000)
FLAG_SUPPORTS_SMALL_SCREENS
public static final int FLAG_SUPPORTS_SMALL_SCREENS
Value for flags
: true when the application's window can be
reduced in size for smaller screens. Corresponds to
android:smallScreens
.
Constant Value: 512 (0x00000200)
FLAG_SUPPORTS_XLARGE_SCREENS
public static final int FLAG_SUPPORTS_XLARGE_SCREENS
Value for flags
: true when the application's window can be
increased in size for extra large screens. Corresponds to
android:xlargeScreens
.
Constant Value: 524288 (0x00080000)
FLAG_SUSPENDED
public static final int FLAG_SUSPENDED
Value for flags
: true if this application's package is in
the suspended state.
Constant Value: 1073741824 (0x40000000)
FLAG_SYSTEM
public static final int FLAG_SYSTEM
Value for flags
: if set, this application is installed in the device's system image.
This should not be used to make security decisions. Instead, rely on
signature checks or
permissions.
Warning: Note that does flag not behave the same as
android:protectionLevel
system
or
signatureOrSystem
.
Constant Value: 1 (0x00000001)
FLAG_TEST_ONLY
public static final int FLAG_TEST_ONLY
Value for flags
: this is set if the application has specified
android:testOnly
to be true.
Constant Value: 256 (0x00000100)
FLAG_UPDATED_SYSTEM_APP
public static final int FLAG_UPDATED_SYSTEM_APP
Value for flags
: this is set if this application has been
installed as an update to a built-in system application.
Constant Value: 128 (0x00000080)
FLAG_USES_CLEARTEXT_TRAFFIC
public static final int FLAG_USES_CLEARTEXT_TRAFFIC
Value for flags
: true
if the application may use cleartext network traffic
(e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP
without STARTTLS or TLS). If false
, the app declares that it does not intend to use
cleartext network traffic, in which case platform components (e.g., HTTP stacks,
DownloadManager
, MediaPlayer
) will refuse app's requests to use cleartext
traffic. Third-party libraries are encouraged to honor this flag as well.
NOTE: WebView
honors this flag for applications targeting API level 26 and up.
This flag is ignored on Android N and above if an Android Network Security Config is present.
This flag comes from
android:usesCleartextTraffic
of the <application> tag.
Constant Value: 134217728 (0x08000000)
FLAG_VM_SAFE_MODE
public static final int FLAG_VM_SAFE_MODE
Value for flags
: set to true if this application would like to
request the VM to operate under the safe mode. Comes from
android:vmSafeMode
of the <application> tag.
Constant Value: 16384 (0x00004000)
GWP_ASAN_ALWAYS
public static final int GWP_ASAN_ALWAYS
Always enable GWP-ASan in this application or process.
Constant Value: 1 (0x00000001)
GWP_ASAN_DEFAULT
public static final int GWP_ASAN_DEFAULT
Default (unspecified) setting of GWP-ASan.
Constant Value: -1 (0xffffffff)
GWP_ASAN_NEVER
public static final int GWP_ASAN_NEVER
Never enable GWP-ASan in this application or process.
Constant Value: 0 (0x00000000)
MEMTAG_ASYNC
public static final int MEMTAG_ASYNC
Enable Memtag in Async mode in this application or process.
Constant Value: 1 (0x00000001)
MEMTAG_DEFAULT
public static final int MEMTAG_DEFAULT
Default (unspecified) setting of Memtag.
Constant Value: -1 (0xffffffff)
MEMTAG_OFF
public static final int MEMTAG_OFF
Do not enable Memtag in this application or process.
Constant Value: 0 (0x00000000)
MEMTAG_SYNC
public static final int MEMTAG_SYNC
Enable Memtag in Sync mode in this application or process.
Constant Value: 2 (0x00000002)
ZEROINIT_DEFAULT
public static final int ZEROINIT_DEFAULT
Default (unspecified) setting of nativeHeapZeroInitialized.
Constant Value: -1 (0xffffffff)
ZEROINIT_DISABLED
public static final int ZEROINIT_DISABLED
Disable zero-initialization of the native heap in this application or process.
Constant Value: 0 (0x00000000)
ZEROINIT_ENABLED
public static final int ZEROINIT_ENABLED
Enable zero-initialization of the native heap in this application or process.
Constant Value: 1 (0x00000001)
Fields
CREATOR
public static final Creator<ApplicationInfo> CREATOR
appComponentFactory
public String appComponentFactory
The factory of this package, as specified by the <manifest>
tag's R.styleable.AndroidManifestApplication_appComponentFactory
attribute.
backupAgentName
public String backupAgentName
Class implementing the Application's backup functionality. From the "backupAgent" attribute. This is an optional attribute and will be null if the application does not specify it in its manifest.
If android:allowBackup is set to false, this attribute is ignored.
category
public int category
The category of this app. Categories are used to cluster multiple apps together into meaningful groups, such as when summarizing battery, network, or disk usage. Apps should only define this value when they fit well into one of the specific categories.
Set from the R.attr.appCategory
attribute in the
manifest. If the manifest doesn't define a category, this value may have
been provided by the installer via
PackageManager#setApplicationCategoryHint(String, int)
.
Value is CATEGORY_UNDEFINED
, CATEGORY_GAME
, CATEGORY_AUDIO
, CATEGORY_VIDEO
, CATEGORY_IMAGE
, CATEGORY_SOCIAL
, CATEGORY_NEWS
, CATEGORY_MAPS
, CATEGORY_PRODUCTIVITY
, or CATEGORY_ACCESSIBILITY
className
public String className
Class implementing the Application object. From the "class" attribute.
compatibleWidthLimitDp
public int compatibleWidthLimitDp
The maximum smallest screen width the application is designed for. If 0,
nothing has been specified. Comes from
android:compatibleWidthLimitDp
attribute of the <supports-screens> tag.
compileSdkVersion
public int compileSdkVersion
The user-visible SDK version (ex. 26) of the framework against which the application claims
to have been compiled, or 0
if not specified.
This property is the compile-time equivalent of
Build.VERSION.SDK_INT
.
compileSdkVersionCodename
public String compileSdkVersionCodename
The development codename (ex. "S", "REL") of the framework against which the application
claims to have been compiled, or null
if not specified.
This property is the compile-time equivalent of
Build.VERSION.CODENAME
.
dataDir
public String dataDir
Full path to the default directory assigned to the package for its persistent data.
descriptionRes
public int descriptionRes
A style resource identifier (in the package's resources) of the description of an application. From the "description" attribute or, if not set, 0.
deviceProtectedDataDir
public String deviceProtectedDataDir
Full path to the device-protected directory assigned to the package for its persistent data.
enabled
public boolean enabled
When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.
largestWidthLimitDp
public int largestWidthLimitDp
The maximum smallest screen width the application will work on. If 0,
nothing has been specified. Comes from
android:largestWidthLimitDp
attribute of the <supports-screens> tag.
manageSpaceActivityName
public String manageSpaceActivityName
Class implementing the Application's manage space functionality. From the "manageSpaceActivity" attribute. This is an optional attribute and will be null if applications don't specify it in their manifest
minSdkVersion
public int minSdkVersion
The minimum SDK version this application can run on. It will not run on earlier versions.
nativeLibraryDir
public String nativeLibraryDir
Full path to the directory where native JNI libraries are stored.
permission
public String permission
Optional name of a permission required to be able to access this application's components. From the "permission" attribute.
processName
public String processName
The name of the process this application should run in. From the "process" attribute or, if not set, the same as packageName.
publicSourceDir
public String publicSourceDir
Full path to the publicly available parts of sourceDir
,
including resources and manifest. This may be different from
sourceDir
if an application is forward locked.
requiresSmallestWidthDp
public int requiresSmallestWidthDp
The required smallest screen width the application can run on. If 0,
nothing has been specified. Comes from
android:requiresSmallestWidthDp
attribute of the <supports-screens> tag.
sharedLibraryFiles
public String[] sharedLibraryFiles
Paths to all shared libraries this application is linked against. This
field is only set if the PackageManager.GET_SHARED_LIBRARY_FILES
flag was used when retrieving
the structure.
splitNames
public String[] splitNames
The names of all installed split APKs, ordered lexicographically.
splitPublicSourceDirs
public String[] splitPublicSourceDirs
Full path to the publicly available parts of splitSourceDirs
,
including resources and manifest. This may be different from
splitSourceDirs
if an application is forward locked.
See also:
splitSourceDirs
public String[] splitSourceDirs
Full paths to zero or more split APKs, indexed by the same order as splitNames
.
storageUuid
public UUID storageUuid
UUID of the storage volume on which this application is being hosted. For
apps hosted on the default internal storage at
Environment#getDataDirectory()
, the UUID value is
StorageManager#UUID_DEFAULT
.
targetSdkVersion
public int targetSdkVersion
The minimum SDK version this application targets. It may run on earlier
versions, but it knows how to work with any new behavior added at this
version. Will be Build.VERSION_CODES.CUR_DEVELOPMENT
if this is a development build and the app is targeting that. You should
compare that this number is >= the SDK version number at which your
behavior was introduced.
taskAffinity
public String taskAffinity
Default task affinity of all activities in this application. See
ActivityInfo#taskAffinity
for more information. This comes
from the "taskAffinity" attribute.
theme
public int theme
A style resource identifier (in the package's resources) of the default visual theme of the application. From the "theme" attribute or, if not set, 0.
uiOptions
public int uiOptions
The default extra UI options for activities in this application.
Set from the R.attr.uiOptions
attribute in the
activity's manifest.
public int uid
The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).
Public constructors
ApplicationInfo
public ApplicationInfo ()
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
int
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0
or CONTENTS_FILE_DESCRIPTOR
getGwpAsanMode
public int getGwpAsanMode ()
getMemtagMode
public int getMemtagMode ()
Returns whether the application has requested Memtag to be enabled, disabled, or left unspecified. Processes can override this setting.
getNativeHeapZeroInitialized
public int getNativeHeapZeroInitialized ()
Returns whether the application has requested automatic zero-initialization of native heap memory allocations to be enabled or disabled.
isProfileableByShell
public boolean isProfileableByShell ()
Returns whether or not this application can be profiled by the shell user, even when running on a device that is running in user mode.
boolean
isResourceOverlay
public boolean isResourceOverlay ()
Returns true if the package has declared in its manifest that it is a runtime resource overlay.
boolean
isVirtualPreload
public boolean isVirtualPreload ()
Returns whether or not this application was installed as a virtual preload.
boolean
loadDescription
public CharSequence loadDescription (PackageManager pm)
Retrieve the textual description of the application. This will call back on the given PackageManager to load the description from the application.
pm
PackageManager
: A PackageManager from which the label can be loaded; usually
the PackageManager from which you originally retrieved this item.
CharSequence
Returns a CharSequence containing the application's description.
If there is no description, null is returned.
toString
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
String
a string representation of the object.
writeToParcel
public void writeToParcel (Parcel dest, int parcelableFlags)
dest
Parcel
parcelableFlags
int
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-05-18 UTC.
-
Follow @AndroidDev on Twitter
-
Check out Android Developers on YouTube
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK