public class ApplicationInfo extends PackageItemInfo implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
ApplicationInfo.DisplayNameComparator |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
String |
backupAgentName
Class implementing the Application's backup functionality.
|
String |
className
Class implementing the Application object.
|
int |
compatibleWidthLimitDp
The maximum smallest screen width the application is designed for.
|
static Parcelable.Creator<ApplicationInfo> |
CREATOR |
String |
dataDir
Full path to a directory assigned to the package for its persistent
data.
|
int |
descriptionRes
A style resource identifier (in the package's resources) of the
description of an application.
|
boolean |
enabled
When false, indicates that all components within this application are
considered disabled, regardless of their individually set enabled status.
|
int |
enabledSetting
For convenient access to the current enabled setting of this app.
|
static 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. |
static int |
FLAG_ALLOW_CLEAR_USER_DATA
Value for
flags : default value for the corresponding ActivityInfo flag. |
static int |
FLAG_ALLOW_TASK_REPARENTING
Value for
flags : default value for the corresponding ActivityInfo flag. |
static int |
FLAG_CANT_SAVE_STATE
Value for
flags : set to true if the application
has reported that it is heavy-weight, and thus can not participate in
the normal application lifecycle. |
static 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. |
static int |
FLAG_EXTERNAL_STORAGE
Value for
flags : Set to true if the application is
currently installed on external/removable/unprotected storage. |
static int |
FLAG_FACTORY_TEST
Value for
flags : set to true if this application holds the
android.Manifest.permission#FACTORY_TEST permission and the
device is running in factory test mode. |
static int |
FLAG_FORWARD_LOCK
Value for
flags : Set to true if the application has been
installed using the forward lock option. |
static int |
FLAG_HAS_CODE
Value for
flags : set to true if this application has code
associated with it. |
static int |
FLAG_INSTALLED
Value for
flags : true if the application is currently
installed for the calling user. |
static 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. |
static 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. |
static int |
FLAG_LARGE_HEAP
Value for
flags : true when the application has requested a
large heap for its processes. |
static int |
FLAG_PERSISTENT
Value for
flags : set to true if this application is persistent. |
static int |
FLAG_RESIZEABLE_FOR_SCREENS
Value for
flags : true when the application knows how to adjust
its UI for different screen sizes. |
static 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. |
static int |
FLAG_STOPPED
Value for
flags : true if this application's package is in
the stopped state. |
static int |
FLAG_SUPPORTS_LARGE_SCREENS
Value for
flags : true when the application's window can be
increased in size for larger screens. |
static int |
FLAG_SUPPORTS_NORMAL_SCREENS
Value for
flags : true when the application's window can be
displayed on normal screens. |
static int |
FLAG_SUPPORTS_RTL
Value for
flags : true when the application is willing to support
RTL (right to left). |
static int |
FLAG_SUPPORTS_SCREEN_DENSITIES
Value for
flags : true when the application knows how to
accomodate different screen densities. |
static int |
FLAG_SUPPORTS_SMALL_SCREENS
Value for
flags : true when the application's window can be
reduced in size for smaller screens. |
static int |
FLAG_SUPPORTS_XLARGE_SCREENS
Value for
flags : true when the application's window can be
increased in size for extra large screens. |
static int |
FLAG_SYSTEM
Value for
flags : if set, this application is installed in the
device's system image. |
static int |
FLAG_TEST_ONLY
Value for
flags : this is set of the application has specified
android:testOnly to be true. |
static int |
FLAG_UPDATED_SYSTEM_APP
Value for
flags : this is set if this application has been
install as an update to a built-in system application. |
static 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 |
flags
Flags associated with the application.
|
int |
installLocation
For convenient access to package's install location.
|
int |
largestWidthLimitDp
The maximum smallest screen width the application will work on.
|
String |
manageSpaceActivityName
Class implementing the Application's manage space
functionality.
|
String |
nativeLibraryDir
Full path to the directory where native JNI libraries are stored.
|
String |
permission
Optional name of a permission required to be able to access this
application's components.
|
String |
processName
The name of the process this application should run in.
|
String |
publicSourceDir
Full path to the location of the publicly available parts of this
package (i.e.
|
int |
requiresSmallestWidthDp
The required smallest screen width the application can run on.
|
String[] |
resourceDirs
Full paths to the locations of extra resource packages this application
uses.
|
String[] |
sharedLibraryFiles
Paths to all shared libraries this application is linked against.
|
String |
sourceDir
Full path to the location of this package.
|
int |
targetSdkVersion
The minimum SDK version this application targets.
|
String |
taskAffinity
Default task affinity of all activities in this application.
|
int |
theme
A style resource identifier (in the package's resources) of the
default visual theme of the application.
|
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).
|
int |
uiOptions
The default extra UI options for activities in this application.
|
icon, labelRes, logo, metaData, name, nonLocalizedLabel, packageName
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
ApplicationInfo() |
ApplicationInfo(ApplicationInfo orig) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
void |
disableCompatibilityMode()
Disable compatibility mode
|
void |
dump(Printer pw,
String prefix) |
protected ApplicationInfo |
getApplicationInfo()
Get the ApplicationInfo for the application to which this item belongs,
if available, otherwise returns null.
|
boolean |
hasRtlSupport() |
protected Drawable |
loadDefaultIcon(PackageManager pm)
Retrieve the default graphical icon associated with this item.
|
CharSequence |
loadDescription(PackageManager pm)
Retrieve the textual description of the application.
|
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
void |
writeToParcel(Parcel dest,
int parcelableFlags)
Flatten this object in to a Parcel.
|
dumpBack, dumpFront, loadDefaultLogo, loadIcon, loadLabel, loadLogo, loadXmlMetaData
public String taskAffinity
ActivityInfo.taskAffinity
for more information. This comes
from the "taskAffinity" attribute.public String permission
public String processName
public String className
public int descriptionRes
public int theme
public String manageSpaceActivityName
public String backupAgentName
If android:allowBackup is set to false, this attribute is ignored.
public int uiOptions
android.R.attr#uiOptions
attribute in the
activity's manifest.public static final int FLAG_SYSTEM
flags
: if set, this application is installed in the
device's system image.public static final int FLAG_DEBUGGABLE
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.public static final int FLAG_HAS_CODE
flags
: set to true if this application has code
associated with it. Comes
from android:hasCode
of the <application> tag.public static final int FLAG_PERSISTENT
flags
: set to true if this application is persistent.
Comes from android:persistent
of the <application> tag.public static final int FLAG_FACTORY_TEST
flags
: set to true if this application holds the
android.Manifest.permission#FACTORY_TEST
permission and the
device is running in factory test mode.public static final int FLAG_ALLOW_TASK_REPARENTING
flags
: default value for the corresponding ActivityInfo flag.
Comes from android:allowTaskReparenting
of the <application> tag.public static final int FLAG_ALLOW_CLEAR_USER_DATA
flags
: default value for the corresponding ActivityInfo flag.
Comes from android:allowClearUserData
of the <application> tag.public static final int FLAG_UPDATED_SYSTEM_APP
flags
: this is set if this application has been
install as an update to a built-in system application.public static final int FLAG_TEST_ONLY
flags
: this is set of the application has specified
android:testOnly
to be true.public static final int FLAG_SUPPORTS_SMALL_SCREENS
flags
: true when the application's window can be
reduced in size for smaller screens. Corresponds to
android:smallScreens
.public static final int FLAG_SUPPORTS_NORMAL_SCREENS
flags
: true when the application's window can be
displayed on normal screens. Corresponds to
android:normalScreens
.public static final int FLAG_SUPPORTS_LARGE_SCREENS
flags
: true when the application's window can be
increased in size for larger screens. Corresponds to
android:largeScreens
.public static final int FLAG_RESIZEABLE_FOR_SCREENS
flags
: true when the application knows how to adjust
its UI for different screen sizes. Corresponds to
android:resizeable
.public static final int FLAG_SUPPORTS_SCREEN_DENSITIES
flags
: true when the application knows how to
accomodate different screen densities. Corresponds to
android:anyDensity
.public static final int FLAG_VM_SAFE_MODE
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.public static final int FLAG_ALLOW_BACKUP
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.
public static final int FLAG_KILL_AFTER_RESTORE
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.
public static final int FLAG_RESTORE_ANY_VERSION
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.
public static final int FLAG_EXTERNAL_STORAGE
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.public static final int FLAG_SUPPORTS_XLARGE_SCREENS
flags
: true when the application's window can be
increased in size for extra large screens. Corresponds to
android:xlargeScreens
.public static final int FLAG_LARGE_HEAP
flags
: true when the application has requested a
large heap for its processes. Corresponds to
android:largeHeap
.public static final int FLAG_STOPPED
flags
: true if this application's package is in
the stopped state.public static final int FLAG_SUPPORTS_RTL
flags
: true when the application is willing to support
RTL (right to left). All activities will inherit this value.
Set from the android.R.attr#supportsRtl
attribute in the
activity's manifest.
Default value is false (no support for RTL).public static final int FLAG_INSTALLED
flags
: true if the application is currently
installed for the calling user.public static final int FLAG_IS_DATA_ONLY
flags
: true if the application only has its
data installed; the application package itself does not currently
exist on the device.public static final int FLAG_FORWARD_LOCK
flags
: Set to true if the application has been
installed using the forward lock option.
NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml.
public static final int FLAG_CANT_SAVE_STATE
flags
: set to true
if the application
has reported that it is heavy-weight, and thus can not participate in
the normal application lifecycle.
Comes from the
android:cantSaveState
attribute of the <application> tag.
public int flags
FLAG_SYSTEM
, FLAG_DEBUGGABLE
, FLAG_HAS_CODE
,
FLAG_PERSISTENT
, FLAG_FACTORY_TEST
, and
FLAG_ALLOW_TASK_REPARENTING
FLAG_ALLOW_CLEAR_USER_DATA
, FLAG_UPDATED_SYSTEM_APP
,
FLAG_TEST_ONLY
, FLAG_SUPPORTS_SMALL_SCREENS
,
FLAG_SUPPORTS_NORMAL_SCREENS
,
FLAG_SUPPORTS_LARGE_SCREENS
, FLAG_SUPPORTS_XLARGE_SCREENS
,
FLAG_RESIZEABLE_FOR_SCREENS
,
FLAG_SUPPORTS_SCREEN_DENSITIES
, FLAG_VM_SAFE_MODE
,
FLAG_INSTALLED
.public int requiresSmallestWidthDp
android:requiresSmallestWidthDp
attribute of the <supports-screens> tag.public int compatibleWidthLimitDp
android:compatibleWidthLimitDp
attribute of the <supports-screens> tag.public int largestWidthLimitDp
android:largestWidthLimitDp
attribute of the <supports-screens> tag.public String sourceDir
public String publicSourceDir
public String[] resourceDirs
public String[] sharedLibraryFiles
PackageManager.GET_SHARED_LIBRARY_FILES
flag was used when retrieving
the structure.public String dataDir
public String nativeLibraryDir
public int uid
public int targetSdkVersion
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.public boolean enabled
public int enabledSetting
public int installLocation
public static final Parcelable.Creator<ApplicationInfo> CREATOR
public ApplicationInfo()
public ApplicationInfo(ApplicationInfo orig)
public boolean hasRtlSupport()
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public int describeContents()
Parcelable
describeContents
in interface Parcelable
public void writeToParcel(Parcel dest, int parcelableFlags)
Parcelable
writeToParcel
in interface Parcelable
writeToParcel
in class PackageItemInfo
dest
- The Parcel in which the object should be written.parcelableFlags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public CharSequence loadDescription(PackageManager pm)
pm
- A PackageManager from which the label can be loaded; usually
the PackageManager from which you originally retrieved this item.public void disableCompatibilityMode()
protected Drawable loadDefaultIcon(PackageManager pm)
PackageItemInfo
loadDefaultIcon
in class PackageItemInfo
pm
- A PackageManager from which the icon can be loaded; usually
the PackageManager from which you originally retrieved this item.protected ApplicationInfo getApplicationInfo()
PackageItemInfo
getApplicationInfo
in class PackageItemInfo