Back to Exoplayer

AssetContentProvider (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/AssetContentProvider.html

latest8.7 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class AssetContentProvider


public final classAssetContentProviderextends[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider.html "class or interface in android.content")implements[ContentProvider.PipeDataWriter](https://developer.android.com/reference/android/content/ContentProvider.PipeDataWriter.html "class or interface in android.content")<[Object](https://developer.android.com/reference/java/lang/Object.html?is-external=true "class or interface in java.lang")>

A ContentProvider for reading asset data.

Nested Class Summary

- 

Nested classes/interfaces inherited from class android.content.ContentProvider

ContentProvider.CallingIdentity, ContentProvider.PipeDataWriter<T extends Object>

Field Summary

- 

Fields inherited from interface android.content.ComponentCallbacks2

TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | AssetContentProvider() | |

Method Summary

All Methods Static Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static Uri | buildUri​(String filePath, boolean pipeMode) | | | int | delete​(Uri uri, String selection, String[] selectionArgs) | | | String | getType​(Uri uri) | | | Uri | insert​(Uri uri, ContentValues values) | | | boolean | onCreate() | | | AssetFileDescriptor | openAssetFile​(Uri uri, String mode) | | | Cursor | query​(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) | | | int | update​(Uri uri, ContentValues values, String selection, String[] selectionArgs) | | | void | writeDataToPipe​(ParcelFileDescriptor output, Uri uri, String mimeType, Bundle opts, Object args) | |

- 

Methods inherited from class android.content.ContentProvider

applyBatch, applyBatch, attachInfo, bulkInsert, call, call, canonicalize, clearCallingIdentity, delete, dump, getCallingAttributionSource, getCallingAttributionTag, getCallingPackage, getCallingPackageUnchecked, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, insert, isTemporary, onCallingPackageChanged, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, requireContext, restoreCallingIdentity, setPathPermissions, setReadPermission, setWritePermission, shutdown, uncanonicalize, update

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

AssetContentProvider

public AssetContentProvider()

Method Detail

- 

buildUri

public static[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")buildUri​([String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")filePath,
                           boolean pipeMode)
- 

onCreate

public boolean onCreate()

Specified by:onCreate in class ContentProvider

- 

query

public[Cursor](https://developer.android.com/reference/android/database/Cursor.html "class or interface in android.database")query​([Uri](https://developer.android.com/reference/android/net/Uri.html?is-external=true "class or interface in android.net")uri,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")[] projection,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")selection,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")[] selectionArgs,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")sortOrder)

Specified by:query in class ContentProvider

- 

openAssetFile

public[AssetFileDescriptor](https://developer.android.com/reference/android/content/res/AssetFileDescriptor.html "class or interface in android.content.res")openAssetFile​([Uri](https://developer.android.com/reference/android/net/Uri.html?is-external=true "class or interface in android.net")uri,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mode)
                                  throws[FileNotFoundException](https://developer.android.com/reference/java/io/FileNotFoundException.html "class or interface in java.io")

Overrides:openAssetFile in class ContentProviderThrows:FileNotFoundException

- 

getType

public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getType​([Uri](https://developer.android.com/reference/android/net/Uri.html?is-external=true "class or interface in android.net")uri)

Specified by:getType in class ContentProvider

- 

insert

public[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")insert​([Uri](https://developer.android.com/reference/android/net/Uri.html?is-external=true "class or interface in android.net")uri,[ContentValues](https://developer.android.com/reference/android/content/ContentValues.html "class or interface in android.content")values)

Specified by:insert in class ContentProvider

- 

delete

public int delete​([Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")selection,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")[] selectionArgs)

Specified by:delete in class ContentProvider

- 

update

public int update​([Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri,[ContentValues](https://developer.android.com/reference/android/content/ContentValues.html "class or interface in android.content")values,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")selection,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")[] selectionArgs)

Specified by:update in class ContentProvider

- 

writeDataToPipe

public void writeDataToPipe​([ParcelFileDescriptor](https://developer.android.com/reference/android/os/ParcelFileDescriptor.html "class or interface in android.os")output,[Uri](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")uri,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")mimeType,
                            @Nullable[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")opts,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")args)

Specified by:writeDataToPipe in interface ContentProvider.PipeDataWriter<Object>