Stay organized with collections Save and categorize content based on your preferences.
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 |
From class Parcelable 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. | |
Inherited functions |
From class ComponentInfo 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. | |
From class PackageItemInfo 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 |
From class ComponentInfo 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. | |
From class PackageItemInfo 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
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
ProviderInfo()
Public methods
describeContents
fun describeContents(): Int
toString
fun toString(): String
Return |
String | a string representation of the object. |
writeToParcel
fun writeToParcel(
out: Parcel,
parcelableFlags: Int
): Unit
Properties
authority
var authority: String!
The name provider is published under content://
flags
var flags: Int
Options that have been set in the provider declaration in the manifest. These include: FLAG_SINGLE_USER
.
forceUriPermissions
var forceUriPermissions: Boolean
If true, always apply URI permission grants, as per the forceUriPermissions
attribute.
grantUriPermissions
var grantUriPermissions: Boolean
If true, additional permissions to specific Uris in this content provider can be granted, as per the grantUriPermissions
attribute.
initOrder
var initOrder: Int
Used to control initialization order of single-process providers running in the same process. Higher goes first.
isSyncable
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
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
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
var readPermission: String!
Optional permission required for read-only access this content provider.
uriPermissionPatterns
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
var writePermission: String!
Optional permission required for read/write access this content provider.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]