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.
|
ConfigurationInfo[] |
configPreferences
Application specified preferred configuration
<uses-configuration> tags included under <manifest>,
or null if there were none. |
static Parcelable.Creator<PackageInfo> |
CREATOR |
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 activity.
|
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 |
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
The features that this application has said it requires.
|
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. |
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.
|
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_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's
marshalled representation.
|
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.
|
public String packageName
public int versionCode
versionCode
attribute.public String versionName
versionName
attribute.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 flags REQUESTED_PERMISSION_REQUIRED
and
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
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 static final Parcelable.Creator<PackageInfo> CREATOR
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
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
.