AssetContentProvider


@UnstableApi
public final class AssetContentProvider extends ContentProvider implements ContentProvider.PipeDataWriter


A ContentProvider for reading asset data.

Summary

Public constructors

Public methods

static Uri
buildUri(String filePath, boolean pipeMode)
int
delete(
    Uri uri,
    @Nullable String selection,
    @Nullable String[] selectionArgs
)
String
getType(Uri uri)
Uri
insert(Uri uri, ContentValues values)
boolean
@Nullable AssetFileDescriptor
openAssetFile(Uri uri, String mode)
Cursor
query(
    Uri uri,
    @Nullable String[] projection,
    @Nullable String selection,
    @Nullable String[] selectionArgs,
    @Nullable String sortOrder
)
int
update(
    Uri uri,
    @Nullable ContentValues values,
    @Nullable String selection,
    @Nullable String[] selectionArgs
)
void
writeDataToPipe(
    ParcelFileDescriptor output,
    Uri uri,
    String mimeType,
    @Nullable Bundle opts,
    @Nullable Object args
)

Inherited Constants

From android.content.ComponentCallbacks2
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Inherited methods

From android.content.ContentProvider
ContentProviderResult[]
applyBatch(
    String authority,
    ArrayList<ContentProviderOperation> operations
)
void
attachInfo(Context context, ProviderInfo info)
int
bulkInsert(Uri uri, ContentValues[] values)
Bundle
call(String authority, String method, String arg, Bundle extras)
Uri
final ContentProvider.CallingIdentity
void
dump(FileDescriptor fd, PrintWriter writer, String[] args)
final AttributionSource
final String
final String
final String
final Context
final PathPermission[]
final String
String[]
getStreamTypes(Uri uri, String mimeTypeFilter)
String
final String
boolean
void
void
void
void
onTrimMemory(int level)
ParcelFileDescriptor
openFile(Uri uri, String mode)
final ParcelFileDescriptor
openFileHelper(Uri uri, String mode)
ParcelFileDescriptor
<T> openPipeHelper(
    Uri uri,
    String mimeType,
    Bundle opts,
    T args,
    ContentProvider.PipeDataWriter<T> func
)
AssetFileDescriptor
openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts)
boolean
refresh(Uri uri, Bundle extras, CancellationSignal cancellationSignal)
final Context
final void
final void
setPathPermissions(PathPermission[] permissions)
final void
final void
void
Uri

Public constructors

AssetContentProvider

public AssetContentProvider()

Public methods

buildUri

public static Uri buildUri(String filePath, boolean pipeMode)

delete

public int delete(
    Uri uri,
    @Nullable String selection,
    @Nullable String[] selectionArgs
)

getType

public String getType(Uri uri)

insert

public Uri insert(Uri uri, ContentValues values)

onCreate

public boolean onCreate()

openAssetFile

public @Nullable AssetFileDescriptor openAssetFile(Uri uri, String mode)

query

public Cursor query(
    Uri uri,
    @Nullable String[] projection,
    @Nullable String selection,
    @Nullable String[] selectionArgs,
    @Nullable String sortOrder
)

update

public int update(
    Uri uri,
    @Nullable ContentValues values,
    @Nullable String selection,
    @Nullable String[] selectionArgs
)

writeDataToPipe

public void writeDataToPipe(
    ParcelFileDescriptor output,
    Uri uri,
    String mimeType,
    @Nullable Bundle opts,
    @Nullable Object args
)