public class PackageInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
ActivityInfo[] |
activities
Array of all
<activity> tags included under <application>,
or null if there were none. |
ApplicationInfo |
applicationInfo
Information collected from the <application> tag, or null if
there was none.
|
int |
baseRevisionCode
The revision number of the base APK for this package, as specified by the
<manifest> tag's
revisionCode
attribute. |
ConfigurationInfo[] |
configPreferences
Application specified preferred configuration
<uses-configuration> tags included under <manifest>,
or null if there were none. |
boolean |
coreApp |
static Parcelable.Creator<PackageInfo> |
CREATOR |
FeatureGroupInfo[] |
featureGroups
Groups of features that this application has requested.
|
long |
firstInstallTime
The time at which the app was first installed.
|
int[] |
gids
All kernel group-IDs that have been assigned to this package.
|
static int |
INSTALL_LOCATION_AUTO
Constant corresponding to
auto in the
android.R.attr#installLocation attribute. |
static int |
INSTALL_LOCATION_INTERNAL_ONLY
Constant corresponding to
internalOnly in the
android.R.attr#installLocation attribute. |
static int |
INSTALL_LOCATION_PREFER_EXTERNAL
Constant corresponding to
preferExternal in the
android.R.attr#installLocation attribute. |
static int |
INSTALL_LOCATION_UNSPECIFIED
Constant corresponding to
auto in
the android.R.attr#installLocation attribute. |
int |
installLocation
The install location requested by the package.
|
InstrumentationInfo[] |
instrumentation
Array of all
<instrumentation> tags included under <manifest>,
or null if there were none. |
long |
lastUpdateTime
The time at which the app was last updated.
|
String |
overlayTarget
What package, if any, this package will overlay.
|
String |
packageName
The name of this package.
|
PermissionInfo[] |
permissions
Array of all
<permission> tags included under <manifest>,
or null if there were none. |
ProviderInfo[] |
providers
Array of all
<provider> tags included under <application>,
or null if there were none. |
ActivityInfo[] |
receivers
Array of all
<receiver> tags included under <application>,
or null if there were none. |
FeatureInfo[] |
reqFeatures
Features that this application has requested.
|
static int |
REQUESTED_PERMISSION_GRANTED
Flag for
requestedPermissionsFlags : the requested permission
is currently granted to the application. |
static int |
REQUESTED_PERMISSION_REQUIRED
Flag for
requestedPermissionsFlags : the requested permission
is required for the application to run; the user can not optionally
disable it. |
String[] |
requestedPermissions
Array of all
<uses-permission> tags included under <manifest>,
or null if there were none. |
int[] |
requestedPermissionsFlags
Array of flags of all
<uses-permission> tags included under <manifest>,
or null if there were none. |
String |
requiredAccountType |
boolean |
requiredForAllUsers |
String |
restrictedAccountType |
ServiceInfo[] |
services
Array of all
<service> tags included under <application>,
or null if there were none. |
String |
sharedUserId
The shared user ID name of this package, as specified by the <manifest>
tag's
sharedUserId
attribute. |
int |
sharedUserLabel
The shared user ID label of this package, as specified by the <manifest>
tag's
sharedUserLabel
attribute. |
Signature[] |
signatures
Array of all signatures read from the package file.
|
String[] |
splitNames
The names of any installed split APKs for this package.
|
int[] |
splitRevisionCodes
The revision number of any split APKs for this package, as specified by
the <manifest> tag's
revisionCode
attribute. |
int |
versionCode
The version number of this package, as specified by the <manifest>
tag's
versionCode
attribute. |
String |
versionName
The version name of this package, as specified by the <manifest>
tag's
versionName
attribute. |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
PackageInfo() |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int parcelableFlags)
Flatten this object in to a Parcel.
|
public String packageName
public String[] splitNames
public int versionCode
versionCode
attribute.public String versionName
versionName
attribute.public int baseRevisionCode
revisionCode
attribute.public int[] splitRevisionCodes
revisionCode
attribute. Indexes are a 1:1 mapping against splitNames
.public String sharedUserId
sharedUserId
attribute.public int sharedUserLabel
sharedUserLabel
attribute.public ApplicationInfo applicationInfo
public long firstInstallTime
System.currentTimeMillis()
.public long lastUpdateTime
System.currentTimeMillis()
.public int[] gids
PackageManager.GET_GIDS
was set.public ActivityInfo[] activities
<activity>
tags included under <application>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_ACTIVITIES
was set.public ActivityInfo[] receivers
<receiver>
tags included under <application>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_RECEIVERS
was set.public ServiceInfo[] services
<service>
tags included under <application>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_SERVICES
was set.public ProviderInfo[] providers
<provider>
tags included under <application>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_PROVIDERS
was set.public InstrumentationInfo[] instrumentation
<instrumentation>
tags included under <manifest>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_INSTRUMENTATION
was set.public PermissionInfo[] permissions
<permission>
tags included under <manifest>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_PERMISSIONS
was set.public String[] requestedPermissions
<uses-permission>
tags included under <manifest>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_PERMISSIONS
was set. This list includes
all permissions requested, even those that were not granted or known
by the system at install time.public int[] requestedPermissionsFlags
<uses-permission>
tags included under <manifest>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_PERMISSIONS
was set. Each value matches
the corresponding entry in requestedPermissions
, and will have
the flag REQUESTED_PERMISSION_GRANTED
set as appropriate.public static final int REQUESTED_PERMISSION_REQUIRED
requestedPermissionsFlags
: the requested permission
is required for the application to run; the user can not optionally
disable it. Currently all permissions are required.public static final int REQUESTED_PERMISSION_GRANTED
requestedPermissionsFlags
: the requested permission
is currently granted to the application.public Signature[] signatures
PackageManager.GET_SIGNATURES
was set.public ConfigurationInfo[] configPreferences
<uses-configuration>
tags included under <manifest>,
or null if there were none. This is only filled in if the flag
PackageManager.GET_CONFIGURATIONS
was set.public FeatureInfo[] reqFeatures
FeatureInfo.FLAG_REQUIRED
public FeatureGroupInfo[] featureGroups
reqFeatures
and one
or more FeatureGroups in order to have satisfied the feature requirement.FeatureInfo.FLAG_REQUIRED
public static final int INSTALL_LOCATION_UNSPECIFIED
auto
in
the android.R.attr#installLocation
attribute.public static final int INSTALL_LOCATION_AUTO
auto
in the
android.R.attr#installLocation
attribute.public static final int INSTALL_LOCATION_INTERNAL_ONLY
internalOnly
in the
android.R.attr#installLocation
attribute.public static final int INSTALL_LOCATION_PREFER_EXTERNAL
preferExternal
in the
android.R.attr#installLocation
attribute.public int installLocation
android.R.attr#installLocation
attribute, one of
INSTALL_LOCATION_AUTO
, INSTALL_LOCATION_INTERNAL_ONLY
,
INSTALL_LOCATION_PREFER_EXTERNAL
public boolean coreApp
public boolean requiredForAllUsers
public String restrictedAccountType
public String requiredAccountType
public String overlayTarget
public static final Parcelable.Creator<PackageInfo> CREATOR
public String toString()
Object
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())
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int parcelableFlags)
Parcelable
writeToParcel
in interface Parcelable
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
.