Added in API level 1

ProviderInfo


class ProviderInfo : ComponentInfo, Parcelable

Holds information about a specific content provider. This is returned by PackageManager.resolveContentProvider().

Summary

Constants
static Int

Bit in flags: If set, a single instance of the provider will run for all users on the device.

Inherited constants
Int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

Int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel: the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)". Some implementations may want to release resources at this point.

Public constructors

Public methods
Int

Unit
dump(pw: Printer!, prefix: String!)

String

Unit
writeToParcel(out: Parcel, parcelableFlags: Int)

Inherited functions
Unit dumpBack(pw: Printer!, prefix: String!)

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

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.

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.

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.

Boolean isEnabled()

Return whether this component and its enclosing application are enabled.

Drawable! loadBanner(pm: PackageManager!)

Retrieve the current graphical banner associated with this item. This will call back on the given PackageManager to load the banner from the application.

Drawable! loadIcon(pm: PackageManager!)

Retrieve the current graphical icon associated with this item. This will call back on the given PackageManager to load the icon from the application.

CharSequence loadLabel(pm: PackageManager)

Retrieve the current textual label associated with this item. This will call back on the given PackageManager to load the label from the application.

Drawable! loadLogo(pm: PackageManager!)

Retrieve the current graphical logo associated with this item. This will call back on the given PackageManager to load the logo from the application.

Drawable! loadUnbadgedIcon(pm: PackageManager!)

Retrieve the current graphical icon associated with this item without the addition of a work badge if applicable. This will call back on the given PackageManager to load the icon from the application.

XmlResourceParser! loadXmlMetaData(pm: PackageManager!, name: String!)

Load an XML resource attached to the meta-data of this item. This will retrieved the name meta-data entry, and if defined call back on the given PackageManager to load its XML file from the application.

Properties
static Parcelable.Creator<ProviderInfo!>

String!

The name provider is published under content://

Int

Options that have been set in the provider declaration in the manifest.

Boolean

If true, always apply URI permission grants, as per the forceUriPermissions attribute.

Boolean

If true, additional permissions to specific Uris in this content provider can be granted, as per the grantUriPermissions attribute.

Int

Used to control initialization order of single-process providers running in the same process.

Boolean

Whether or not this provider is syncable.

Boolean

If true, this content provider allows multiple instances of itself to run in different process.

Array<PathPermission!>!

If non-null, these are path-specific permissions that are allowed for accessing the provider.

String!

Optional permission required for read-only access this content provider.

Array<PatternMatcher!>!

If non-null, these are the patterns that are allowed for granting URI permissions.

String!

Optional permission required for read/write access this content provider.

Inherited properties
ApplicationInfo! applicationInfo

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

Array<String!>! attributionTags

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.

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.

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

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.

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.

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.

String! splitName

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

Int banner

A drawable resource identifier (in the package's resources) of this component's banner. From the "banner" attribute or, if not set, 0.

Int icon

A drawable resource identifier (in the package's resources) of this component's icon. From the "icon" attribute or, if not set, 0.

Boolean isArchived

Whether the package is currently in an archived state.

Packages can be archived through PackageInstaller.requestArchive and do not have any APKs stored on the device, but do keep the data directory.

Int labelRes

A string resource identifier (in the package's resources) of this component's label. From the "label" attribute or, if not set, 0.

Int logo

A drawable resource identifier (in the package's resources) of this component's logo. Logos may be larger/wider than icons and are displayed by certain UI elements in place of a name or name/icon combination. From the "logo" attribute or, if not set, 0.

Bundle! metaData

Additional meta-data associated with this component. This field will only be filled in if you set the PackageManager.GET_META_DATA flag when requesting the info.

String! name

Public name of this item. From the "android:name" attribute.

CharSequence! nonLocalizedLabel

The string provided in the AndroidManifest file, if any. You probably don't want to use this. You probably want PackageManager.getApplicationLabel

String! packageName

Name of the package that this item is in.

Constants

FLAG_SINGLE_USER

Added in API level 17
static val FLAG_SINGLE_USER: Int

Bit in flags: If set, a single instance of the provider will run for all users on the device. Set from the android.R.attr#singleUser attribute.

Value: 1073741824

Public constructors

ProviderInfo

Added in API level 1
ProviderInfo()

ProviderInfo

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

Public methods

describeContents

Added in API level 1
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

dump

Added in API level 19
fun dump(
    pw: Printer!,
    prefix: String!
): Unit

toString

Added in API level 1
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 1
fun writeToParcel(
    out: Parcel,
    parcelableFlags: Int
): Unit
Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 1
static val CREATOR: Parcelable.Creator<ProviderInfo!>

authority

Added in API level 1
var authority: String!

The name provider is published under content://

flags

Added in API level 17
var flags: Int

Options that have been set in the provider declaration in the manifest. These include: FLAG_SINGLE_USER.

forceUriPermissions

Added in API level 29
var forceUriPermissions: Boolean

If true, always apply URI permission grants, as per the forceUriPermissions attribute.

grantUriPermissions

Added in API level 1
var grantUriPermissions: Boolean

If true, additional permissions to specific Uris in this content provider can be granted, as per the grantUriPermissions attribute.

initOrder

Added in API level 1
var initOrder: Int

Used to control initialization order of single-process providers running in the same process. Higher goes first.

isSyncable

Added in API level 1
Deprecated in API level 15
var isSyncable: Boolean

Deprecated: This flag is now being ignored. The current way to make a provider syncable is to provide a SyncAdapter service for a given provider/account type.

Whether or not this provider is syncable.

multiprocess

Added in API level 1
var multiprocess: Boolean

If true, this content provider allows multiple instances of itself to run in different process. If false, a single instances is always run in processName.

pathPermissions

Added in API level 4
var pathPermissions: Array<PathPermission!>!

If non-null, these are path-specific permissions that are allowed for accessing the provider. Any permissions listed here will allow a holding client to access the provider, and the provider will check the URI it provides when making calls against the patterns here.

readPermission

Added in API level 1
var readPermission: String!

Optional permission required for read-only access this content provider.

uriPermissionPatterns

Added in API level 1
var uriPermissionPatterns: Array<PatternMatcher!>!

If non-null, these are the patterns that are allowed for granting URI permissions. Any URI that does not match one of these patterns will not allowed to be granted. If null, all URIs are allowed. The PackageManager.GET_URI_PERMISSION_PATTERNS flag must be specified for this field to be filled in.

writePermission

Added in API level 1
var writePermission: String!

Optional permission required for read/write access this content provider.