Added in API level 1

ComponentInfo


open class ComponentInfo : PackageItemInfo
kotlin.Any
   ↳ 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

Public constructors

Protected constructors

Public methods
Int

Return the banner resource identifier to use for this component.

Int

Return the icon resource identifier to use for this component.

Int

Return the logo resource identifier to use for this component.

open Boolean

Return whether this component and its enclosing application are enabled.

open Unit
writeToParcel(dest: Parcel!, parcelableFlags: Int)

Protected methods
open Unit
dumpBack(pw: Printer!, prefix: String!)

open Unit
dumpFront(pw: Printer!, prefix: String!)

Inherited functions
Properties
ApplicationInfo!

Global information about the application/package this component is a part of.

Array<String!>!

Set of attribution tags that should be automatically applied to this component.

Int

A string resource identifier (in the package's resources) containing a user-readable description of the component.

Boolean

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).

Boolean

Indicates whether or not this component may be instantiated.

Boolean

Set to true if this component is available for use by other applications.

String!

The name of the process this component should run in.

String!

The name of the split in which this component is declared.

Inherited properties

Public constructors

ComponentInfo

Added in API level 1
ComponentInfo()

ComponentInfo

Added in API level 1
ComponentInfo(orig: ComponentInfo!)

Protected constructors

ComponentInfo

Added in API level 1
protected ComponentInfo(source: Parcel!)

Public methods

getBannerResource

Added in API level 20
fun getBannerResource(): Int

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.

Return
Int The banner associated with this component.

getIconResource

Added in API level 1
fun getIconResource(): Int

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.

Return
Int The icon associated with this component.

getLogoResource

Added in API level 19
fun getLogoResource(): Int

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.

Return
Int The logo associated with this component.

isEnabled

Added in API level 11
open fun isEnabled(): Boolean

Return whether this component and its enclosing application are enabled.

writeToParcel

Added in API level 1
open fun writeToParcel(
    dest: Parcel!,
    parcelableFlags: Int
): Unit

Protected methods

dumpBack

Added in API level 1
protected open fun dumpBack(
    pw: Printer!,
    prefix: String!
): Unit

dumpFront

Added in API level 1
protected open fun dumpFront(
    pw: Printer!,
    prefix: String!
): Unit

Properties

applicationInfo

Added in API level 1
var applicationInfo: ApplicationInfo!

Global information about the application/package this component is a part of.

attributionTags

Added in API level 31
var attributionTags: Array<String!>!

Set of attribution tags that should be automatically applied to this component.

When this component represents an Activity, Service, ContentResolver or BroadcastReceiver, each instance will be automatically configured with Context#createAttributionContext using the first attribution tag contained here.

Additionally, when this component represents a BroadcastReceiver and the sender of a broadcast requires the receiver to hold one or more specific permissions, those permission checks will be performed using each of the attributions tags contained here.

descriptionRes

Added in API level 8
var descriptionRes: Int

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

Added in API level 24
var directBootAware: Boolean

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

Added in API level 1
var enabled: Boolean

Indicates whether or not this component may be instantiated. Note that this value can be overridden by the one in its parent ApplicationInfo.

exported

Added in API level 1
var exported: Boolean

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

Added in API level 1
var processName: String!

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

Added in API level 26
var splitName: String!

The name of the split in which this component is declared. Null if the component was declared in the base APK.