为什么RECEIVE_SMS和READ_SMS权限没有不同的提示框要求权限?

Why does RECEIVE_SMS and READ_SMS permission do not have different prompt boxes to ask for permission?

我在我的应用程序的清单文件中列出了 RECEIVE_SMS 和 READ_SMS 的权限,它们也有不同的权限字符串。

授予相应的权限。但是,我注意到在(由用户)授予任何一项权限(READ_SMSRECEIVE_SMS)时,我们可以执行这两项任务。我的问题是,如果他们两个执行不同的任务:

1) READ_SMS: 它允许应用读取用户 phone.

上的所有短信(当前存在)

2) RECEIVE_SMS: 它允许应用收听用户 phone 而 he/she 收到的所有短信正在使用应用程序。

他们都在请求权限和拒绝其中一个权限时显示相同的对话框,这两个对话框都不会出现。

如果两者具有相同的权限授予场景,那么为什么将它们以两种权限的形式分开?如果你们中的任何人能帮助我理解这一点,那将对我有很大的帮助。

根据Android documentation on Requesting Permissions

Permission groups:
All dangerous Android system permissions belong to permission groups. If the device is running Android 6.0 (API level 23) and the app's targetSdkVersion is 23 or higher, the following system behavior applies when your app requests a dangerous permission:

If an app requests a dangerous permission listed in its manifest, and the app does not currently have any permissions in the permission group, the system shows a dialog box to the user describing the permission group that the app wants access to. The dialog box does not describe the specific permission within that group. For example, if an app requests the READ_CONTACTS permission, the system dialog box just says the app needs access to the device's contacts. If the user grants approval, the system gives the app just the permission it requested.

If an app requests a dangerous permission listed in its manifest, and the app already has another dangerous permission in the same permission group, the system immediately grants the permission without any interaction with the user. For example, if an app had previously requested and been granted the READ_CONTACTS permission, and it then requests WRITE_CONTACTS, the system immediately grants that permission.

注意:Android SDK 的未来版本可能会将特定权限从一个组移动到另一个组。因此,不要将您的应用程序逻辑基于这些权限组的结构。 例如,如果你的应用程序请求 READ_CONTACTS 权限,然后是 WRITE_CONTACTS 权限,你不应该假设系统可以自动授予 WRITE_CONTACTS 权限,即使它是在同一个权限从 Android 8.0(API 级别 26)起分组为 READ_CONTACTS。

所有与 SMS 相关的权限都属于权限组 SMS
以下是短信权限组下的权限列表:

  • SEND_SMS
  • SEND_SMS
  • RECEIVE_SMS
  • READ_SMS
  • RECEIVE_WAP_PUSH
  • RECEIVE_MMS