Class AssetContentProvider
- java.lang.Object
-
- android.content.ContentProvider
-
- com.google.android.exoplayer2.testutil.AssetContentProvider
-
- All Implemented Interfaces:
ComponentCallbacks
,ComponentCallbacks2
,ContentProvider.PipeDataWriter<Object>
public final class AssetContentProvider extends ContentProvider implements ContentProvider.PipeDataWriter<Object>
AContentProvider
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
-
-
-
-
Method Detail
-
onCreate
public boolean onCreate()
- Specified by:
onCreate
in classContentProvider
-
query
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
- Specified by:
query
in classContentProvider
-
openAssetFile
public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException
- Overrides:
openAssetFile
in classContentProvider
- Throws:
FileNotFoundException
-
getType
public String getType(Uri uri)
- Specified by:
getType
in classContentProvider
-
insert
public Uri insert(Uri uri, ContentValues values)
- Specified by:
insert
in classContentProvider
-
delete
public int delete(Uri uri, String selection, String[] selectionArgs)
- Specified by:
delete
in classContentProvider
-
update
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs)
- Specified by:
update
in classContentProvider
-
writeDataToPipe
public void writeDataToPipe(ParcelFileDescriptor output, Uri uri, String mimeType, @Nullable Bundle opts, @Nullable Object args)
- Specified by:
writeDataToPipe
in interfaceContentProvider.PipeDataWriter<Object>
-
-