ProviderInfo


public final class ProviderInfo
extends ComponentInfo implements Parcelable

java.lang.Object
   ↳ android.content.pm.PackageItemInfo
     ↳ android.content.pm.ComponentInfo
       ↳ android.content.pm.ProviderInfo


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

Summary

Constants

int FLAG_SINGLE_USER

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(Parcel, int): 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)".

Fields

public static final Creator<ProviderInfo> CREATOR

public String authority

The name provider is published under content://

public int flags

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

public boolean forceUriPermissions

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

public boolean grantUriPermissions

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

public int initOrder

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

public boolean isSyncable

This field was deprecated in API level 15. 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.

public boolean multiprocess

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

public PathPermission[] pathPermissions

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

public String readPermission

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

public PatternMatcher[] uriPermissionPatterns

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

public String writePermission

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

Inherited fields

public ApplicationInfo applicationInfo

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

public String[] attributionTags

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

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.

public int banner

A drawable resource identifier (in the package's resources) of this component's banner.

public int icon

A drawable resource identifier (in the package's resources) of this component's icon.

public boolean isArchived

Whether the package is currently in an archived state.

public int labelRes

A string resource identifier (in the package's resources) of this component's label.

public int logo

A drawable resource identifier (in the package's resources) of this component's logo.

public Bundle metaData

Additional meta-data associated with this component.

public String name

Public name of this item.

public CharSequence nonLocalizedLabel

The string provided in the AndroidManifest file, if any.

public String packageName

Name of the package that this item is in.

Public constructors

ProviderInfo()
ProviderInfo(ProviderInfo orig)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

void dump(Printer pw, String prefix)
String toString()

Returns a string representation of the object.

void writeToParcel(Parcel out, int parcelableFlags)

Inherited methods

void dumpBack(Printer pw, String prefix)
void dumpFront(Printer pw, String prefix)
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.

void writeToParcel(Parcel dest, int parcelableFlags)
void dumpBack(Printer pw, String prefix)
void dumpFront(Printer pw, String prefix)
Drawable loadBanner(PackageManager pm)

Retrieve the current graphical banner associated with this item.

Drawable loadIcon(PackageManager pm)

Retrieve the current graphical icon associated with this item.

CharSequence loadLabel(PackageManager pm)

Retrieve the current textual label associated with this item.

Drawable loadLogo(PackageManager pm)

Retrieve the current graphical logo associated with this item.

Drawable loadUnbadgedIcon(PackageManager pm)

Retrieve the current graphical icon associated with this item without the addition of a work badge if applicable.

XmlResourceParser loadXmlMetaData(PackageManager pm, String name)

Load an XML resource attached to the meta-data of this item.

void writeToParcel(Parcel dest, int parcelableFlags)
Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

abstract int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Constants

FLAG_SINGLE_USER

Added in API level 17
public static final int FLAG_SINGLE_USER

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

Constant Value: 1073741824 (0x40000000)

Fields

CREATOR

Added in API level 1
public static final Creator<ProviderInfo> CREATOR

authority

Added in API level 1
public String authority

The name provider is published under content://

flags

Added in API level 17
public int flags

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

forceUriPermissions

Added in API level 29
public boolean forceUriPermissions

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

grantUriPermissions

Added in API level 1
public boolean grantUriPermissions

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
public int initOrder

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
public boolean isSyncable

This field was deprecated in API level 15.
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
public boolean multiprocess

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

pathPermissions

Added in API level 4
public PathPermission[] pathPermissions

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
public String readPermission

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

uriPermissionPatterns

Added in API level 1
public PatternMatcher[] uriPermissionPatterns

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
public String writePermission

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

Public constructors

ProviderInfo

Added in API level 1
public ProviderInfo ()

ProviderInfo

Added in API level 1
public ProviderInfo (ProviderInfo orig)

Parameters
orig ProviderInfo

Public methods

describeContents

Added in API level 1
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

dump

Added in API level 19
public void dump (Printer pw, 
                String prefix)

Parameters
pw Printer

prefix String

toString

Added in API level 1
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.

writeToParcel

Added in API level 1
public void writeToParcel (Parcel out, 
                int parcelableFlags)

Parameters
out Parcel

parcelableFlags int