Class MAMContentProvider
-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.ComponentCallbacks2,com.microsoft.intune.mam.client.app.MAMIdentityRequirementListener,com.microsoft.intune.mam.client.content.HookedContentProvider
public abstract class MAMContentProvider extends ContentProvider implements HookedContentProviderMAM version of ContentProvider.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intTRIM_MEMORY_BACKGROUNDpublic final static intTRIM_MEMORY_COMPLETEpublic final static intTRIM_MEMORY_MODERATEpublic final static intTRIM_MEMORY_RUNNING_CRITICALpublic final static intTRIM_MEMORY_RUNNING_LOWpublic final static intTRIM_MEMORY_RUNNING_MODERATEpublic final static intTRIM_MEMORY_UI_HIDDEN
-
Constructor Summary
Constructors Constructor Description MAMContentProvider()Constructor.
-
Method Summary
Modifier and Type Method Description voidattachInfo(Context context, ProviderInfo info)final Array<ContentProviderResult>applyBatch(ArrayList<ContentProviderOperation> operations)final Array<ContentProviderResult>applyBatch(String authority, ArrayList<ContentProviderOperation> operations)final intbulkInsert(Uri uri, Array<ContentValues> values)final Bundlecall(String method, String arg, Bundle extras)final Bundlecall(String authority, String method, String arg, Bundle extras)final intdelete(Uri uri, String selection, Array<String> selectionArgs)final intdelete(Uri uri, Bundle extras)final Uriinsert(Uri uri, ContentValues values)final Uriinsert(Uri uri, ContentValues values, Bundle extras)final AssetFileDescriptoropenAssetFile(Uri uri, String mode)final AssetFileDescriptoropenAssetFile(Uri uri, String mode, CancellationSignal signal)final ParcelFileDescriptoropenFile(Uri uri, String mode)final ParcelFileDescriptoropenFile(Uri uri, String mode, CancellationSignal signal)final AssetFileDescriptoropenTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts)final AssetFileDescriptoropenTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal)final Cursorquery(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder)final Cursorquery(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder, CancellationSignal cancellationSignal)final Cursorquery(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal)final intupdate(Uri uri, ContentValues values, String selection, Array<String> selectionArgs)final intupdate(Uri uri, ContentValues values, Bundle extras)voidattachInfoMAM(Context context, ProviderInfo info)MAM version of attachInfo. Array<ContentProviderResult>applyBatchMAM(ArrayList<ContentProviderOperation> operations)MAM version of applyBatch. Array<ContentProviderResult>applyBatchMAM(String authority, ArrayList<ContentProviderOperation> operations)MAM version of applyBatch. intbulkInsertMAM(Uri uri, Array<ContentValues> values)MAM version of bulkInsert. BundlecallMAM(String method, String arg, Bundle extras)MAM version of call. BundlecallMAM(String authority, String method, String arg, Bundle extras)MAM version of call. intdeleteMAM(Uri uri, Bundle extras)MAM version of delete. UriinsertMAM(Uri uri, ContentValues values, Bundle extras)MAM version of insert. AssetFileDescriptoropenAssetFileMAM(Uri uri, String mode)MAM version of openAssetFile. AssetFileDescriptoropenAssetFileMAM(Uri uri, String mode, CancellationSignal signal)MAM version of openAssetFile. ParcelFileDescriptoropenFileMAM(Uri uri, String mode)MAM version of openFile. ParcelFileDescriptoropenFileMAM(Uri uri, String mode, CancellationSignal signal)MAM version of openFile. AssetFileDescriptoropenTypedAssetFileMAM(Uri uri, String mimeTypeFilter, Bundle opts)MAM version of openTypedAssetFile. AssetFileDescriptoropenTypedAssetFileMAM(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal)MAM version of openTypedAssetFile. CursorqueryMAM(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder, CancellationSignal cancellationSignal)MAM version of query. CursorqueryMAM(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal)MAM version of query. intupdateMAM(Uri uri, ContentValues values, Bundle extras)MAM version of update. final booleanisProvideContentAllowed(@NonNull() String contentIdentity)A multi-identity aware app MUST use this method to determine whether policy allows sharing of content to another app. static booleanisProvideContentAllowed(@NonNull() ContentProvider provider, @Nullable() String contentIdentity)Like the instance-method isProvideContentAllowed above, but static. final booleanisProvideContentAllowedForOID(@NonNull() String oid)A multi-identity aware app MUST use this method to determine whether policy allows sharing of content to another app. static booleanisProvideContentAllowedForOid(@NonNull() ContentProvider provider, @Nullable() String oid)Like the instance-method isProvideContentAllowed above, but static. -
Methods inherited from class android.content.ContentProvider
canonicalize, clearCallingIdentity, dump, getCallingAttributionSource, getCallingAttributionTag, getCallingPackage, getCallingPackageUnchecked, getContext, getPathPermissions, getReadPermission, getStreamTypes, getType, getTypeAnonymous, getWritePermission, onCallingPackageChanged, onConfigurationChanged, onCreate, onLowMemory, onTrimMemory, openPipeHelper, refresh, requireContext, restoreCallingIdentity, shutdown, uncanonicalize -
Methods inherited from class com.microsoft.intune.mam.client.content.HookedContentProvider
deleteMAM, insertMAM, queryMAM, updateMAM -
Methods inherited from class com.microsoft.intune.mam.client.app.MAMIdentityRequirementListener
onMAMIdentitySwitchRequired, onMAMIdentitySwitchRequired -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
attachInfo
void attachInfo(Context context, ProviderInfo info)
-
applyBatch
final Array<ContentProviderResult> applyBatch(ArrayList<ContentProviderOperation> operations)
-
applyBatch
final Array<ContentProviderResult> applyBatch(String authority, ArrayList<ContentProviderOperation> operations)
-
bulkInsert
final int bulkInsert(Uri uri, Array<ContentValues> values)
-
delete
@RequiresApi(api = Build.VERSION_CODES.R) final int delete(Uri uri, Bundle extras)
-
insert
final Uri insert(Uri uri, ContentValues values)
-
insert
@RequiresApi(api = Build.VERSION_CODES.R) final Uri insert(Uri uri, ContentValues values, Bundle extras)
-
openAssetFile
final AssetFileDescriptor openAssetFile(Uri uri, String mode)
-
openAssetFile
final AssetFileDescriptor openAssetFile(Uri uri, String mode, CancellationSignal signal)
-
openTypedAssetFile
final AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts)
-
openTypedAssetFile
final AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal)
-
query
final Cursor query(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder)
-
query
final Cursor query(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder, CancellationSignal cancellationSignal)
-
query
@RequiresApi(value = Build.VERSION_CODES.O) final Cursor query(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal)
-
update
final int update(Uri uri, ContentValues values, String selection, Array<String> selectionArgs)
-
update
@RequiresApi(api = Build.VERSION_CODES.R) final int update(Uri uri, ContentValues values, Bundle extras)
-
attachInfoMAM
void attachInfoMAM(Context context, ProviderInfo info)
MAM version of attachInfo.
- Parameters:
context- See ContentProvider.info- See ContentProvider.
-
applyBatchMAM
Array<ContentProviderResult> applyBatchMAM(ArrayList<ContentProviderOperation> operations)
MAM version of applyBatch.
- Parameters:
operations- See ContentProvider.- Returns:
See ContentProvider.
-
applyBatchMAM
Array<ContentProviderResult> applyBatchMAM(String authority, ArrayList<ContentProviderOperation> operations)
MAM version of applyBatch.
- Parameters:
authority- See ContentProvider.operations- See ContentProvider.- Returns:
See ContentProvider.
-
bulkInsertMAM
int bulkInsertMAM(Uri uri, Array<ContentValues> values)
MAM version of bulkInsert.
- Parameters:
uri- See ContentProvider.values- See ContentProvider.- Returns:
See ContentProvider.
-
callMAM
Bundle callMAM(String method, String arg, Bundle extras)
MAM version of call.
- Parameters:
method- See ContentProvider.arg- See ContentProvider.extras- See ContentProvider.- Returns:
See ContentProvider.
-
callMAM
Bundle callMAM(String authority, String method, String arg, Bundle extras)
MAM version of call.
- Parameters:
authority- See ContentProvider.method- See ContentProvider.arg- See ContentProvider.extras- See ContentProvider.- Returns:
See ContentProvider.
-
deleteMAM
@RequiresApi(api = Build.VERSION_CODES.R) int deleteMAM(Uri uri, Bundle extras)
MAM version of delete.
- Parameters:
uri- See ContentProvider.extras- See ContentProvider.- Returns:
See ContentProvider.
-
insertMAM
@RequiresApi(api = Build.VERSION_CODES.R) Uri insertMAM(Uri uri, ContentValues values, Bundle extras)
MAM version of insert.
- Parameters:
uri- See ContentProvider.values- See ContentProvider.extras- See ContentProvider.- Returns:
See ContentProvider.
-
openAssetFileMAM
AssetFileDescriptor openAssetFileMAM(Uri uri, String mode)
MAM version of openAssetFile.
- Parameters:
uri- See ContentProvider.mode- See ContentProvider.- Returns:
See ContentProvider.
-
openAssetFileMAM
AssetFileDescriptor openAssetFileMAM(Uri uri, String mode, CancellationSignal signal)
MAM version of openAssetFile.
- Parameters:
uri- See ContentProvider.mode- See ContentProvider.signal- See ContentProvider.- Returns:
See ContentProvider.
-
openFileMAM
ParcelFileDescriptor openFileMAM(Uri uri, String mode)
MAM version of openFile.
- Parameters:
uri- See ContentProvider.mode- See ContentProvider.- Returns:
See ContentProvider.
-
openFileMAM
ParcelFileDescriptor openFileMAM(Uri uri, String mode, CancellationSignal signal)
MAM version of openFile.
- Parameters:
uri- See ContentProvider.mode- See ContentProvider.signal- See ContentProvider.- Returns:
See ContentProvider.
-
openTypedAssetFileMAM
AssetFileDescriptor openTypedAssetFileMAM(Uri uri, String mimeTypeFilter, Bundle opts)
MAM version of openTypedAssetFile.
- Parameters:
uri- See ContentProvider.mimeTypeFilter- See ContentProvider.opts- See ContentProvider.- Returns:
See ContentProvider.
-
openTypedAssetFileMAM
AssetFileDescriptor openTypedAssetFileMAM(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal)
MAM version of openTypedAssetFile.
- Parameters:
uri- See ContentProvider.mimeTypeFilter- See ContentProvider.opts- See ContentProvider.signal- See ContentProvider.- Returns:
See ContentProvider.
-
queryMAM
Cursor queryMAM(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder, CancellationSignal cancellationSignal)
MAM version of query.
- Parameters:
uri- See ContentProvider.projection- See ContentProvider.selection- See ContentProvider.selectionArgs- See ContentProvider.sortOrder- See ContentProvider.cancellationSignal- See ContentProvider.- Returns:
See ContentProvider.
-
queryMAM
@RequiresApi(value = Build.VERSION_CODES.O) Cursor queryMAM(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal)
MAM version of query.
- Parameters:
uri- See ContentProvider.projection- See ContentProvider.queryArgs- See ContentProvider.cancellationSignal- See ContentProvider.- Returns:
See ContentProvider.
-
updateMAM
@RequiresApi(api = Build.VERSION_CODES.R) int updateMAM(Uri uri, ContentValues values, Bundle extras)
MAM version of update.
- Parameters:
uri- See ContentProvider.values- See ContentProvider.extras- See ContentProvider.- Returns:
See ContentProvider.
-
isProvideContentAllowed
@Deprecated() final boolean isProvideContentAllowed(@NonNull() String contentIdentity)
A multi-identity aware app MUST use this method to determine whether policy allows sharing of content to another app. This method may be called only from the implementation of a MAMContentProvider method (callqueryMAM, callMAM, etc). It allows the app to determine whether the content it is about to return to the app which invoked the content provider is allowed to be provided. If this method returns false, the content must not be provided. It is not necessary to use this method for content which can never contain corporate data. It is also not necessary to use this method when returning a ParcelFileDescriptor through openFileMAM, openAssetFileMAM, or openTypedAssetFileMAM as the underlying file is required to already be tagged with the correct identity.
- Parameters:
contentIdentity- UPN representing the owner of the content.- Returns:
true if the content is allowed to be provided, false if it is not
-
isProvideContentAllowed
@Deprecated() static boolean isProvideContentAllowed(@NonNull() ContentProvider provider, @Nullable() String contentIdentity)
Like the instance-method isProvideContentAllowed above, but static. Allows usage of isProvideContentAllowed from a ContentProvider which is intended to be processed by the MAM build plugin rather than inheriting MAMContentProvider in source.
- Parameters:
provider- provider to use for the checkcontentIdentity- UPN representing the owner of the content.- Returns:
true if the content is allowed to be provided, false if it is not
-
isProvideContentAllowedForOID
final boolean isProvideContentAllowedForOID(@NonNull() String oid)
A multi-identity aware app MUST use this method to determine whether policy allows sharing of content to another app. This method may be called only from the implementation of a MAMContentProvider method (callqueryMAM, callMAM, etc). It allows the app to determine whether the content it is about to return to the app which invoked the content provider is allowed to be provided. If this method returns false, the content must not be provided. It is not necessary to use this method for content which can never contain corporate data. It is also not necessary to use this method when returning a ParcelFileDescriptor through openFileMAM, openAssetFileMAM, or openTypedAssetFileMAM as the underlying file is required to already be tagged with the correct identity.
- Parameters:
oid- OID representing the owner of the content.- Returns:
true if the content is allowed to be provided, false if it is not
-
isProvideContentAllowedForOid
static boolean isProvideContentAllowedForOid(@NonNull() ContentProvider provider, @Nullable() String oid)
Like the instance-method isProvideContentAllowed above, but static. Allows usage of isProvideContentAllowed from a ContentProvider which is intended to be processed by the MAM build plugin rather than inheriting MAMContentProvider in source.
- Parameters:
provider- provider to use for the checkoid- OID representing the owner of the content.- Returns:
true if the content is allowed to be provided, false if it is not
-
-
-
-