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 HookedContentProvider
                        

    MAM version of ContentProvider.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void attachInfo(Context context, ProviderInfo info)
      final Array<ContentProviderResult> applyBatch(ArrayList<ContentProviderOperation> operations)
      final Array<ContentProviderResult> applyBatch(String authority, ArrayList<ContentProviderOperation> operations)
      final int bulkInsert(Uri uri, Array<ContentValues> values)
      final Bundle call(String method, String arg, Bundle extras)
      final Bundle call(String authority, String method, String arg, Bundle extras)
      final int delete(Uri uri, String selection, Array<String> selectionArgs)
      final int delete(Uri uri, Bundle extras)
      final Uri insert(Uri uri, ContentValues values)
      final Uri insert(Uri uri, ContentValues values, Bundle extras)
      final AssetFileDescriptor openAssetFile(Uri uri, String mode)
      final AssetFileDescriptor openAssetFile(Uri uri, String mode, CancellationSignal signal)
      final ParcelFileDescriptor openFile(Uri uri, String mode)
      final ParcelFileDescriptor openFile(Uri uri, String mode, CancellationSignal signal)
      final AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts)
      final AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal)
      final Cursor query(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder)
      final Cursor query(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder, CancellationSignal cancellationSignal)
      final Cursor query(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal)
      final int update(Uri uri, ContentValues values, String selection, Array<String> selectionArgs)
      final int update(Uri uri, ContentValues values, Bundle extras)
      void attachInfoMAM(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.
      int bulkInsertMAM(Uri uri, Array<ContentValues> values) MAM version of bulkInsert.
      Bundle callMAM(String method, String arg, Bundle extras) MAM version of call.
      Bundle callMAM(String authority, String method, String arg, Bundle extras) MAM version of call.
      int deleteMAM(Uri uri, Bundle extras) MAM version of delete.
      Uri insertMAM(Uri uri, ContentValues values, Bundle extras) MAM version of insert.
      AssetFileDescriptor openAssetFileMAM(Uri uri, String mode) MAM version of openAssetFile.
      AssetFileDescriptor openAssetFileMAM(Uri uri, String mode, CancellationSignal signal) MAM version of openAssetFile.
      ParcelFileDescriptor openFileMAM(Uri uri, String mode) MAM version of openFile.
      ParcelFileDescriptor openFileMAM(Uri uri, String mode, CancellationSignal signal) MAM version of openFile.
      AssetFileDescriptor openTypedAssetFileMAM(Uri uri, String mimeTypeFilter, Bundle opts) MAM version of openTypedAssetFile.
      AssetFileDescriptor openTypedAssetFileMAM(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal) MAM version of openTypedAssetFile.
      Cursor queryMAM(Uri uri, Array<String> projection, String selection, Array<String> selectionArgs, String sortOrder, CancellationSignal cancellationSignal) MAM version of query.
      Cursor queryMAM(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal) MAM version of query.
      int updateMAM(Uri uri, ContentValues values, Bundle extras) MAM version of update.
      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.
      static boolean isProvideContentAllowed(@NonNull() ContentProvider provider, @Nullable() String contentIdentity) Like the instance-method isProvideContentAllowed above, but static.
      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.
      static boolean isProvideContentAllowedForOid(@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
    • Constructor Detail

      • MAMContentProvider

        MAMContentProvider()

        Constructor.

    • Method Detail

      • attachInfo

         void attachInfo(Context context, ProviderInfo info)
      • 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, CancellationSignal signal)
      • openFile

         final ParcelFileDescriptor openFile(Uri uri, String mode)
      • openFile

         final ParcelFileDescriptor openFile(Uri uri, String mode, CancellationSignal signal)
      • openTypedAssetFile

         final AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts, CancellationSignal signal)
      • query

        @RequiresApi(value = Build.VERSION_CODES.O) final Cursor query(Uri uri, Array<String> projection, Bundle queryArgs, CancellationSignal cancellationSignal)
      • 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 check
        contentIdentity - 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 check
        oid - OID representing the owner of the content.
        Returns:

        true if the content is allowed to be provided, false if it is not