android.content.Context.revokeUriPermission()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(259)

本文整理了Java中android.content.Context.revokeUriPermission()方法的一些代码示例,展示了Context.revokeUriPermission()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.revokeUriPermission()方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:revokeUriPermission

Context.revokeUriPermission介绍

暂无

代码示例

代码示例来源:origin: oasisfeng/condom

@Override public void revokeUriPermission(Uri uri, int modeFlags) {
  mBase.revokeUriPermission(uri, modeFlags);
}

代码示例来源:origin: oasisfeng/condom

@RequiresApi(O) @Override public void revokeUriPermission(final String toPackage, final Uri uri, final int modeFlags) {
  mBase.revokeUriPermission(toPackage, uri, modeFlags);
}

代码示例来源:origin: Trumeet/MiPushFramework

@Override public void revokeUriPermission(Uri uri, int modeFlags) {
  mBase.revokeUriPermission(uri, modeFlags);
}

代码示例来源:origin: Trumeet/MiPushFramework

@RequiresApi(O) @Override public void revokeUriPermission(final String toPackage, final Uri uri, final int modeFlags) {
  mBase.revokeUriPermission(toPackage, uri, modeFlags);
}

代码示例来源:origin: jkwiecien/EasyImage

private static void revokeWritePermission(@NonNull Context context, Uri uri) {
  context.revokeUriPermission(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}

代码示例来源:origin: zendesk/belvedere

/**
 * 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);
}

代码示例来源:origin: klinker41/android-smsmms

@Override
protected void revokeUriPermission(Context context) {
  context.revokeUriPermission(mContentUri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
}

代码示例来源:origin: esafirm/android-image-picker

public static void revokeAppPermission(Context context, Uri fileUri) {
  context.revokeUriPermission(fileUri,
      Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}

代码示例来源:origin: nguyenhoanglam/ImagePicker

public static void revokeAppPermission(Context context, Uri fileUri) {
  context.revokeUriPermission(fileUri,
      Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}

代码示例来源:origin: klinker41/android-smsmms

@Override
  protected void revokeUriPermission(Context context) {
    try {
      context.revokeUriPermission(mPduUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
    } catch (NullPointerException e) {
      Log.e(TAG, "error revoking permissions", e);
    }
  }
}

代码示例来源:origin: miguelbcr/RxPaparazzo

public static void revokeFileReadWritePermissions(TargetUi targetUi, Uri uri) {
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
    targetUi.getContext().revokeUriPermission(uri, READ_WRITE_PERMISSIONS);
  }
}

代码示例来源:origin: gigabytedevelopers/FireFiles

static void onDownloadProviderDelete(Context context, long id) {
  final Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, Long.toString(id));
  context.revokeUriPermission(uri, ~0);
}

代码示例来源:origin: gigabytedevelopers/FireFiles

/**
 * 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);
}

代码示例来源:origin: gigabytedevelopers/FireFiles

/**
 * When deleting an item, we need to revoke any outstanding Uri grants.
 */
static void onMediaStoreDelete(Context context, String volumeName, int type, long id) {
  if (!"external".equals(volumeName)) return;
  if (type == FileColumns.MEDIA_TYPE_IMAGE) {
    final Uri uri = DocumentsContract.buildDocumentUri(
        AUTHORITY, getDocIdForIdent(TYPE_IMAGE, id));
    context.revokeUriPermission(uri, ~0);
  } else if (type == FileColumns.MEDIA_TYPE_VIDEO) {
    final Uri uri = DocumentsContract.buildDocumentUri(
        AUTHORITY, getDocIdForIdent(TYPE_VIDEO, id));
    context.revokeUriPermission(uri, ~0);
  } else if (type == FileColumns.MEDIA_TYPE_AUDIO) {
    final Uri uri = DocumentsContract.buildDocumentUri(
        AUTHORITY, getDocIdForIdent(TYPE_AUDIO, id));
    context.revokeUriPermission(uri, ~0);
  }
}

相关文章

Context类方法