public class ComponentInfo extends PackageItemInfo
ActivityInfo
, ServiceInfo
). This class is not intended
to be used by itself; it is simply here to share common definitions
between all application components. As such, it does not itself
implement Parcelable, but does provide convenience methods to assist
in the implementation of Parcelable in subclasses.PackageItemInfo.DisplayNameComparator
Modifier and Type | Field and Description |
---|---|
ApplicationInfo |
applicationInfo
Global information about the application/package this component is a
part of.
|
int |
descriptionRes
A string resource identifier (in the package's resources) containing
a user-readable description of the component.
|
boolean |
enabled
Indicates whether or not this component may be instantiated.
|
boolean |
exported
Set to true if this component is available for use by other applications.
|
String |
processName
The name of the process this component should run in.
|
icon, labelRes, logo, metaData, name, nonLocalizedLabel, packageName
Modifier | Constructor and Description |
---|---|
|
ComponentInfo() |
|
ComponentInfo(ComponentInfo orig) |
protected |
ComponentInfo(Parcel source) |
Modifier and Type | Method and Description |
---|---|
protected void |
dumpBack(Printer pw,
String prefix) |
protected void |
dumpFront(Printer pw,
String prefix) |
protected ApplicationInfo |
getApplicationInfo()
Get the ApplicationInfo for the application to which this item belongs,
if available, otherwise returns null.
|
int |
getIconResource()
Return the icon resource identifier to use for this component.
|
boolean |
isEnabled()
Return whether this component and its enclosing application are enabled.
|
protected Drawable |
loadDefaultIcon(PackageManager pm)
Retrieve the default graphical icon associated with this item.
|
protected Drawable |
loadDefaultLogo(PackageManager pm)
Retrieve the default graphical logo associated with this item.
|
CharSequence |
loadLabel(PackageManager pm)
Retrieve the current textual label associated with this item.
|
void |
writeToParcel(Parcel dest,
int parcelableFlags) |
loadIcon, loadLogo, loadXmlMetaData
public ApplicationInfo applicationInfo
public String processName
public int descriptionRes
public boolean enabled
ApplicationInfo
.public boolean exported
android:exported
of the
<activity>, <receiver>, <service>, or
<provider> tag.public ComponentInfo()
public ComponentInfo(ComponentInfo orig)
protected ComponentInfo(Parcel source)
public CharSequence loadLabel(PackageManager pm)
PackageItemInfo
loadLabel
in class PackageItemInfo
pm
- A PackageManager from which the label can be loaded; usually
the PackageManager from which you originally retrieved this item.public boolean isEnabled()
public final int getIconResource()
protected void dumpFront(Printer pw, String prefix)
dumpFront
in class PackageItemInfo
protected void dumpBack(Printer pw, String prefix)
dumpBack
in class PackageItemInfo
public void writeToParcel(Parcel dest, int parcelableFlags)
writeToParcel
in class PackageItemInfo
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 Drawable loadDefaultLogo(PackageManager pm)
PackageItemInfo
loadDefaultLogo
in class PackageItemInfo
pm
- A PackageManager from which the logo can be loaded; usually
the PackageManager from which you originally retrieved this item.protected ApplicationInfo getApplicationInfo()
PackageItemInfo
getApplicationInfo
in class PackageItemInfo