lightbulb_outline Please take our October 2018 developer survey. Start survey

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

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

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.

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

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

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. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

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