从 Android 11 开始,对麦克风的使用引入了新的限制。 Android 给出了一些豁免。 https://developer.android.com/guide/components/foreground-services#bg-access-restriction-exemptions 。我对最后一个感兴趣 -
The service is started by an app that has the START_ACTIVITIES_FROM_BACKGROUND privileged permission.
我在 AndroidManifest.xml 中声明了这一点并将其列入允许列表,但是,当应用程序在后台运行时,我仍然无法使用麦克风。以前有人遇到过这个吗?权限真的能帮助应用摆脱限制吗?谢谢
最佳答案
START_ACTIVITIES_FROM_BACKGROUND
不是 Android SDK 的一部分。并且其 protectionLevel
设置为 signature|privileged|vendorPrivileged|oem|verifier
,至少在 Android 11 上是这样。普通应用无法持有此权限。
关于Android 11 对麦克风使用的限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68855281/