ComponentInfo
public
class
ComponentInfo
extends PackageItemInfo
| java.lang.Object | ||
| ↳ | android.content.pm.PackageItemInfo | |
| ↳ | android.content.pm.ComponentInfo | |
|
|
Base class containing information common to all application components
(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.
Summary
Fields | |
|---|---|
public
ApplicationInfo |
applicationInfo
Global information about the application/package this component is a part of. |
public
int |
descriptionRes
A string resource identifier (in the package's resources) containing a user-readable description of the component. |
public
boolean |
directBootAware
Indicates if this component is aware of direct boot lifecycle, and can be safely run before the user has entered their credentials (such as a lock pattern or PIN). |
public
boolean |
enabled
Indicates whether or not this component may be instantiated. |
public
boolean |
exported
Set to true if this component is available for use by other applications. |
public
String |
processName
The name of the process this component should run in. |
public
String |
splitName
The name of the split in which this component is declared. |
Inherited fields |
|---|
android.content.pm.PackageItemInfo
|
Public constructors | |
|---|---|
ComponentInfo()
|
|
ComponentInfo(ComponentInfo orig)
|
|
Protected constructors | |
|---|---|
ComponentInfo(Parcel source)
|
|
Public methods | |
|---|---|
final
int
|
getBannerResource()
Return the banner resource identifier to use for this component. |
final
int
|
getIconResource()
Return the icon resource identifier to use for this component. |
final
int
|
getLogoResource()
Return the logo resource identifier to use for this component. |
boolean
|
isEnabled()
Return whether this component and its enclosing application are enabled. |
CharSequence
|
loadLabel(PackageManager pm)
Retrieve the current textual label associated with this item. |
void
|
writeToParcel(Parcel dest, int parcelableFlags)
|
Protected methods | |
|---|---|
void
|
dumpBack(Printer pw, String prefix)
|
void
|
dumpFront(Printer pw, String prefix)
|
Inherited methods | |
|---|---|
android.content.pm.PackageItemInfo
| |
java.lang.Object
| |
Fields
applicationInfo
ApplicationInfo applicationInfo
Global information about the application/package this component is a part of.
descriptionRes
int descriptionRes
A string resource identifier (in the package's resources) containing a user-readable description of the component. From the "description" attribute or, if not set, 0.
directBootAware
boolean directBootAware
Indicates if this component is aware of direct boot lifecycle, and can be safely run before the user has entered their credentials (such as a lock pattern or PIN).
enabled
boolean enabled
Indicates whether or not this component may be instantiated. Note that this value can be
overridden by the one in its parent ApplicationInfo.
exported
boolean exported
Set to true if this component is available for use by other applications.
Comes from android:exported of the
<activity>, <receiver>, <service>, or
<provider> tag.
processName
String processName
The name of the process this component should run in. From the "android:process" attribute or, if not set, the same as applicationInfo.processName.
splitName
String splitName
The name of the split in which this component is declared. Null if the component was declared in the base APK.
Public constructors
Protected constructors
Public methods
getBannerResource
int getBannerResource ()
Return the banner resource identifier to use for this component. If the component defines a banner, that is used; else, the application banner is used.
| Returns | |
|---|---|
int |
The banner associated with this component. |
getIconResource
int getIconResource ()
Return the icon resource identifier to use for this component. If the component defines an icon, that is used; else, the application icon is used.
| Returns | |
|---|---|
int |
The icon associated with this component. |
getLogoResource
int getLogoResource ()
Return the logo resource identifier to use for this component. If the component defines a logo, that is used; else, the application logo is used.
| Returns | |
|---|---|
int |
The logo associated with this component. |
isEnabled
boolean isEnabled ()
Return whether this component and its enclosing application are enabled.
| Returns | |
|---|---|
boolean |
|
loadLabel
CharSequence loadLabel (PackageManager pm)
Retrieve the current textual label associated with this item. This will call back on the given PackageManager to load the label from the application.
| Parameters | |
|---|---|
pm |
PackageManager: A PackageManager from which the label can be loaded; usually
the PackageManager from which you originally retrieved this item. |
| Returns | |
|---|---|
CharSequence |
Returns a CharSequence containing the item's label. If the item does not have a label, its name is returned. |
writeToParcel
void writeToParcel (Parcel dest, int parcelableFlags)
| Parameters | |
|---|---|
dest |
Parcel |
parcelableFlags |
int |
Protected methods
dumpBack
void dumpBack (Printer pw, String prefix)
| Parameters | |
|---|---|
pw |
Printer |
prefix |
String |
dumpFront
void dumpFront (Printer pw, String prefix)
| Parameters | |
|---|---|
pw |
Printer |
prefix |
String |
Classes
- ActivityInfo
- ActivityInfo.WindowLayout
- ApplicationInfo
- ApplicationInfo.DisplayNameComparator
- ChangedPackages
- ComponentInfo
- ConfigurationInfo
- FeatureGroupInfo
- FeatureInfo
- InstrumentationInfo
- LabeledIntent
- LauncherActivityInfo
- LauncherApps
- LauncherApps.Callback
- LauncherApps.PinItemRequest
- LauncherApps.ShortcutQuery
- PackageInfo
- PackageInstaller
- PackageInstaller.Session
- PackageInstaller.SessionCallback
- PackageInstaller.SessionInfo
- PackageInstaller.SessionParams
- PackageItemInfo
- PackageItemInfo.DisplayNameComparator
- PackageManager
- PackageStats
- PathPermission
- PermissionGroupInfo
- PermissionInfo
- ProviderInfo
- ResolveInfo
- ResolveInfo.DisplayNameComparator
- ServiceInfo
- SharedLibraryInfo
- ShortcutInfo
- ShortcutInfo.Builder
- ShortcutManager
- Signature
- VersionedPackage
Exceptions