public class AcraContentProvider extends ContentProvider
AcraCore.attachmentUris()ContentProvider.PipeDataWriter<T>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 and Description |
|---|
AcraContentProvider() |
| Modifier and Type | Method and Description |
|---|---|
int |
delete(Uri uri,
String selection,
String[] selectionArgs) |
String |
getType(Uri uri)
Provides file mimeType
|
static Uri |
getUriForFile(Context context,
Directory directory,
String relativePath)
Get an uri for this content provider for the given file
|
static Uri |
getUriForFile(Context context,
File file)
Get an uri for this content provider for the given file
|
static String |
guessMimeType(Uri uri)
Tries to guess the mime type from uri extension
|
Uri |
insert(Uri uri,
ContentValues values) |
boolean |
onCreate() |
ParcelFileDescriptor |
openFile(Uri uri,
String mode)
Open a file for read
|
Cursor |
query(Uri uri,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder)
Provides file metadata
|
int |
update(Uri uri,
ContentValues values,
String selection,
String[] selectionArgs) |
applyBatch, attachInfo, bulkInsert, call, canonicalize, dump, getCallingPackage, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, isTemporary, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, setPathPermissions, setReadPermission, setWritePermission, shutdown, uncanonicalizepublic boolean onCreate()
onCreate in class ContentProvider@Nullable public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder)
query in class ContentProvideruri - the file uriprojection - any combination of OpenableColumns.DISPLAY_NAME and OpenableColumns.SIZEselection - ignoredselectionArgs - ignoredsortOrder - ignored@NonNull public String getType(@NonNull Uri uri)
getType in class ContentProvideruri - the file uriMIME_TYPE_OCTET_STREAMguessMimeType(Uri)@Nullable public Uri insert(@NonNull Uri uri, @Nullable ContentValues values)
insert in class ContentProvideruri - ignoredvalues - ignoredUnsupportedOperationException - alwayspublic int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs)
delete in class ContentProvideruri - ignoredselection - ignoredselectionArgs - ignoredUnsupportedOperationException - alwayspublic int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs)
update in class ContentProvideruri - ignoredvalues - ignoredselection - ignoredselectionArgs - ignoredUnsupportedOperationException - always@NonNull public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException
openFile in class ContentProvideruri - the file urimode - ignoredParcelFileDescriptor for the FileFileNotFoundException - if the file cannot be resolved@NonNull public static Uri getUriForFile(@NonNull Context context, @NonNull File file)
context - a contextfile - the file@NonNull public static Uri getUriForFile(@NonNull Context context, @NonNull Directory directory, @NonNull String relativePath)
context - a contextdirectory - the directory, to with the path is relativerelativePath - the file path@NonNull public static String guessMimeType(@NonNull Uri uri)
uri - the uriMIME_TYPE_OCTET_STREAM