# AssetContentProvider

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/AssetContentProvider.java+class:androidx.media3.test.utils.AssetContentProvider)

*** ** * ** ***


```
@UnstableApi
class AssetContentProvider : ContentProvider, ContentProvider.PipeDataWriter<Any!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.content.ContentProvider](https://developer.android.com/reference/android/content/ContentProvider.html) ||
|   | ↳ | [androidx.media3.test.utils.AssetContentProvider](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider) |

*** ** * ** ***

A `https://developer.android.com/reference/android/content/ContentProvider.html` for reading asset data.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#AssetContentProvider()()` |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#buildUri(java.lang.String,java.lang.String,boolean)(authority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, filePath: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, pipeMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#delete(android.net.Uri,java.lang.String,java.lang.String[])(uri: https://developer.android.com/reference/android/net/Uri.html!, selection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, selectionArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#getType(android.net.Uri)(uri: https://developer.android.com/reference/android/net/Uri.html!)` |
| `https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#insert(android.net.Uri,android.content.ContentValues)(uri: https://developer.android.com/reference/android/net/Uri.html!, values: https://developer.android.com/reference/android/content/ContentValues.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#onCreate()()` |
| `https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#openAssetFile(android.net.Uri,java.lang.String)(uri: https://developer.android.com/reference/android/net/Uri.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://developer.android.com/reference/android/database/Cursor.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#query(android.net.Uri,java.lang.String[],java.lang.String,java.lang.String[],java.lang.String)( uri: https://developer.android.com/reference/android/net/Uri.html!, projection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>?, selection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, selectionArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>?, sortOrder: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#update(android.net.Uri,android.content.ContentValues,java.lang.String,java.lang.String[])( uri: https://developer.android.com/reference/android/net/Uri.html!, values: https://developer.android.com/reference/android/content/ContentValues.html?, selection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, selectionArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>? )` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/AssetContentProvider#writeDataToPipe(android.os.ParcelFileDescriptor,android.net.Uri,java.lang.String,android.os.Bundle,java.lang.Object)( output: https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!, uri: https://developer.android.com/reference/android/net/Uri.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, opts: https://developer.android.com/reference/android/os/Bundle.html?, args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html? )` |

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40` `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20`

### Inherited functions

From [android.content.ContentProvider](https://developer.android.com/reference/android/content/ContentProvider.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/ContentProviderResult.html!>!` `https://developer.android.com/reference/android/content/ContentProvider.html#applyBatch(java.lang.String, java.util.ArrayList&lt;android.content.ContentProviderOperation&gt;)(
authority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
operations: https://developer.android.com/reference/java/util/ArrayList.html<https://developer.android.com/reference/android/content/ContentProviderOperation.html!>!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#attachInfo(android.content.Context, android.content.pm.ProviderInfo)(context: https://developer.android.com/reference/android/content/Context.html!, info: https://developer.android.com/reference/android/content/pm/ProviderInfo.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#bulkInsert(android.net.Uri, android.content.ContentValues[])(uri: https://developer.android.com/reference/android/net/Uri.html!, values: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/ContentValues.html!>!)` `https://developer.android.com/reference/android/os/Bundle.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#call(java.lang.String, java.lang.String, android.os.Bundle)(method: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, arg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` `https://developer.android.com/reference/android/net/Uri.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#canonicalize(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` `https://developer.android.com/reference/android/content/ContentProvider.CallingIdentity.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#clearCallingIdentity()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#delete(android.net.Uri, android.os.Bundle)(uri: https://developer.android.com/reference/android/net/Uri.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])(fd: https://developer.android.com/reference/java/io/FileDescriptor.html!, writer: https://developer.android.com/reference/java/io/PrintWriter.html!, args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` `https://developer.android.com/reference/android/content/AttributionSource.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getCallingAttributionSource()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getCallingAttributionTag()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getCallingPackage()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getCallingPackageUnchecked()()` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getContext()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/pm/PathPermission.html!>!` `https://developer.android.com/reference/android/content/ContentProvider.html#getPathPermissions()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getReadPermission()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` `https://developer.android.com/reference/android/content/ContentProvider.html#getStreamTypes(android.net.Uri, java.lang.String)(uri: https://developer.android.com/reference/android/net/Uri.html!, mimeTypeFilter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getTypeAnonymous(android.net.Uri)(uri: https://developer.android.com/reference/android/net/Uri.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#getWritePermission()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#isTemporary()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#onCallingPackageChanged()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#onConfigurationChanged(android.content.res.Configuration)(newConfig: https://developer.android.com/reference/android/content/res/Configuration.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#onLowMemory()()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#onTrimMemory(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#openFile(android.net.Uri, java.lang.String)(uri: https://developer.android.com/reference/android/net/Uri.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#openFileHelper(android.net.Uri, java.lang.String)(uri: https://developer.android.com/reference/android/net/Uri.html!, mode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://developer.android.com/reference/android/os/ParcelFileDescriptor.html!` `<T> https://developer.android.com/reference/android/content/ContentProvider.html#openPipeHelper(android.net.Uri, java.lang.String, android.os.Bundle, T, android.content.ContentProvider.PipeDataWriter&lt;T&gt;)(
uri: https://developer.android.com/reference/android/net/Uri.html!,
mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
opts: https://developer.android.com/reference/android/os/Bundle.html!,
args: T!,
func: https://developer.android.com/reference/android/content/ContentProvider.PipeDataWriter.html<T!>!
)` `https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#openTypedAssetFile(android.net.Uri, java.lang.String, android.os.Bundle)(uri: https://developer.android.com/reference/android/net/Uri.html!, mimeTypeFilter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, opts: https://developer.android.com/reference/android/os/Bundle.html!)` `https://developer.android.com/reference/android/database/Cursor.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#query(android.net.Uri, java.lang.String[], android.os.Bundle, android.os.CancellationSignal)(
uri: https://developer.android.com/reference/android/net/Uri.html!,
projection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!,
queryArgs: https://developer.android.com/reference/android/os/Bundle.html!,
cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html!
)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#refresh(android.net.Uri, android.os.Bundle, android.os.CancellationSignal)(uri: https://developer.android.com/reference/android/net/Uri.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!, cancellationSignal: https://developer.android.com/reference/android/os/CancellationSignal.html!)` `https://developer.android.com/reference/android/content/Context.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#requireContext()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#restoreCallingIdentity(android.content.ContentProvider.CallingIdentity)(identity: https://developer.android.com/reference/android/content/ContentProvider.CallingIdentity.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#setPathPermissions(android.content.pm.PathPermission[])(permissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/android/content/pm/PathPermission.html!>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#setReadPermission(java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#setWritePermission(java.lang.String)(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#shutdown()()` `https://developer.android.com/reference/android/net/Uri.html!` `https://developer.android.com/reference/android/content/ContentProvider.html#uncanonicalize(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ContentProvider.html#update(android.net.Uri, android.content.ContentValues, android.os.Bundle)(uri: https://developer.android.com/reference/android/net/Uri.html!, values: https://developer.android.com/reference/android/content/ContentValues.html!, extras: https://developer.android.com/reference/android/os/Bundle.html!)`

## Public constructors

### AssetContentProvider

```
AssetContentProvider()
```

## Public functions

### buildUri

```
java-static fun buildUri(authority: String!, filePath: String!, pipeMode: Boolean): Uri!
```

### delete

```
fun delete(uri: Uri!, selection: String?, selectionArgs: Array<String!>?): Int
```

### getType

```
fun getType(uri: Uri!): String!
```

### insert

```
fun insert(uri: Uri!, values: ContentValues!): Uri!
```

### onCreate

```
fun onCreate(): Boolean
```

### openAssetFile

```
fun openAssetFile(uri: Uri!, mode: String!): AssetFileDescriptor?
```

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/FileNotFoundException.html` |   |

### query

```
fun query(
    uri: Uri!,
    projection: Array<String!>?,
    selection: String?,
    selectionArgs: Array<String!>?,
    sortOrder: String?
): Cursor!
```

### update

```
fun update(
    uri: Uri!,
    values: ContentValues?,
    selection: String?,
    selectionArgs: Array<String!>?
): Int
```

### writeDataToPipe

```
fun writeDataToPipe(
    output: ParcelFileDescriptor!,
    uri: Uri!,
    mimeType: String!,
    opts: Bundle?,
    args: Any?
): Unit
```