内容提供者的应用程序如何指定客户端应用程序访问提供者数据所需的权限?

How does Content Provider's application specify permissions that client apps need in order to access the provider's data?

背景

我正在阅读this tutorial on Android Content Providers。我从本教程中了解到,

为了让其他应用程序访问内容提供者的数据,提供者应用程序必须指定客户端应用程序访问其提供者数据所需的权限。

客户端应用程序使用 <uses-permission> 元素在其清单文件中指定所需的权限,例如

<uses-permission android:name="android.permission.READ_USER_DICTIONARY" > <!-- In the client app's manifest -->

然后当用户安装客户端应用程序时,APK 管理器会询问用户是否同意这些权限(在客户端应用程序中)。

问题

我的问题是提供者(应用程序)如何指定必须授予其他客户端应用程序才能访问提供者数据的权限?

来自developer guide

To find the exact name of the read access permission for the provider you're using, as well as the names for other access permissions used by the provider, look in the provider's documentation.

这就是在提供商应用程序中指定这些权限的方式 - 在 提供商的文档 中?如果是这样,该文档在哪里找到?我在哪里可以找到 SearchableDictionary 提供程序的文档(在教程中用作示例),如果我在我的应用程序中编写内容提供程序,我应该在哪里提供该文档?

在提供商应用程序中定义权限 AndroidManifest.xml

<permission
    android:name="com.myapp.PERMISSION"/>

在提供商应用程序中定义提供商 AndroidManifest.xml

<provider
        android:name=".MyProvider"
        android:authorities="com.myapp.MyProvider.AUTHORITY"
        android:enabled="true"
        android:exported="true"
        android:multiprocess="true"
        android:readPermission="com.myapp.PERMISSION" />

客户的 AndroidManifest.xml 应该有使用权限标签

<uses-permission android:name="com.myapp.PERMISSION"/>

然后客户端可以访问提供者

Cursor cursor = getContentResolver().query(
Uri.parse("content://com.myapp.MyProvider.AUTHORITY/xxx" ),null, null, null, null);

并且不要忘记在客户端(B 应用程序)中将其包含在 AndroidManifest.xml 之外......这对我有用

<queries>
        <provider android:authorities="com.myapp.MyProvider.AUTHORITY" />
    </queries>