android 请求许可我不请求

android requesting permission I'm not asking for

在我的 android 清单中,我从未请求允许我的应用程序录制音频的权限,但是当我 运行 我的应用程序在 Galaxy s7 上时,会弹出一个请求此类权限的窗口.

奇怪的是,只有当我在 s7 上 运行 时才会发生这种情况,如果我在 s6 上 运行 我的应用程序不会请求录制音频的权限。

有人知道为什么它在我从未将其包含在我的 android 清单中时请求录制音频的权限,以及为什么它只发生在 s7 而不是 s6 上。

谢谢

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app's functionality; for example, a user could choose to give a camera app access to the camera but not to the device location. The user can revoke the permissions at any time, by going to the app's Settings screen

Requesting Permissions at Run Time

The weird thing is this only happens when I run on an s7, if I run my app on an s6 it does not request permission to record audio.

发生这种情况基本上是因为您的 s7 设备可能有 lollipop 或更高 android 版本。并且 s6 具有较低的 API 级别 (<23);

感谢 CommonsWare 在评论中发帖 link,帮我解决了问题。

基本上我所做的就是添加

使用权限 android:name="android.permission.RECORD_AUDIO" tools:node="remove"

到我的清单文件,它不再请求许可。