Java Code Examples for android.content.Context#revokeUriPermission()

The following examples show how to use android.content.Context#revokeUriPermission() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImagePickerUtils.java    From SSForms with GNU General Public License v3.0 4 votes vote down vote up
public static void revokeAppPermission(Context context, Uri fileUri) {
    context.revokeUriPermission(fileUri,
            Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
 
Example 2
Source File: DownloadStorageProvider.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
static void onDownloadProviderDelete(Context context, long id) {
    final Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, Long.toString(id));
    context.revokeUriPermission(uri, ~0);
}
 
Example 3
Source File: DownloadStorageProvider.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
static void onDownloadProviderDelete(Context context, long id) {
    final Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, Long.toString(id));
    context.revokeUriPermission(uri, ~0);
}
 
Example 4
Source File: DownloadStorageProvider.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
static void onDownloadProviderDelete(Context context, long id) {
    final Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, Long.toString(id));
    context.revokeUriPermission(uri, ~0);
}
 
Example 5
Source File: DocumentsProvider.java    From android_9.0.0_r45 with Apache License 2.0 2 votes vote down vote up
/**
 * Revoke any active permission grants for the given
 * {@link Document#COLUMN_DOCUMENT_ID}, usually called when a document
 * becomes invalid. Follows the same semantics as
 * {@link Context#revokeUriPermission(Uri, int)}.
 */
public final void revokeDocumentPermission(String documentId) {
    final Context context = getContext();
    context.revokeUriPermission(buildDocumentUri(mAuthority, documentId), ~0);
    context.revokeUriPermission(buildTreeDocumentUri(mAuthority, documentId), ~0);
}
 
Example 6
Source File: DocumentsProvider.java    From FireFiles with Apache License 2.0 2 votes vote down vote up
/**
 * Revoke any active permission grants for the given
 * {@link DocumentsContract.Document#COLUMN_DOCUMENT_ID}, usually called when a document
 * becomes invalid. Follows the same semantics as
 * {@link android.content.Context#revokeUriPermission(android.net.Uri, int)}.
 */
public final void revokeDocumentPermission(String documentId) {
    final Context context = getContext();
    context.revokeUriPermission(buildDocumentUri(mAuthority, documentId), ~0);
    context.revokeUriPermission(buildTreeDocumentUri(mAuthority, documentId), ~0);
}
 
Example 7
Source File: DocumentsProvider.java    From FireFiles with Apache License 2.0 2 votes vote down vote up
/**
 * Revoke any active permission grants for the given
 * {@link DocumentsContract.Document#COLUMN_DOCUMENT_ID}, usually called when a document
 * becomes invalid. Follows the same semantics as
 * {@link android.content.Context#revokeUriPermission(android.net.Uri, int)}.
 */
public final void revokeDocumentPermission(String documentId) {
    final Context context = getContext();
    context.revokeUriPermission(buildDocumentUri(mAuthority, documentId), ~0);
    context.revokeUriPermission(buildTreeDocumentUri(mAuthority, documentId), ~0);
}
 
Example 8
Source File: DocumentsProvider.java    From FireFiles with Apache License 2.0 2 votes vote down vote up
/**
 * Revoke any active permission grants for the given
 * {@link DocumentsContract.Document#COLUMN_DOCUMENT_ID}, usually called when a document
 * becomes invalid. Follows the same semantics as
 * {@link android.content.Context#revokeUriPermission(android.net.Uri, int)}.
 */
public final void revokeDocumentPermission(String documentId) {
    final Context context = getContext();
    context.revokeUriPermission(buildDocumentUri(mAuthority, documentId), ~0);
    context.revokeUriPermission(buildTreeDocumentUri(mAuthority, documentId), ~0);
}
 
Example 9
Source File: Storage.java    From belvedere with Apache License 2.0 2 votes vote down vote up
/**
 * Revoke the specified permission from an {@link Uri}.
 *
 * @param context    A valid application {@link Context}
 * @param uri        An {@link Uri} to a file, managed by our {@link BelvedereFileProvider}
 * @param permission Permissions that should be revoked
 */
void revokePermissionsFromUri(Context context, Uri uri, int permission) {
    context.revokeUriPermission(uri, permission);
}