Android 11 对麦克风使用的限制

标签 android android-service android-permissions background-service android-11

从 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/

相关文章:

Android ResultReceiver 跨包

Android - 我如何知道所有需要特定权限的方法?

android - 从 Android Studio '3.2 Canary 16' 升级到 '3.2 Beta 1' 后数据绑定(bind)编译错误

android - 每天在 Android 中的预定义时间安排 GPS 位置检查

android - 收缩资源不适用于库模块

android - 将 registerReceiver 用于非 Activity 和非服务类

android - 服务可以在 Android M 中请求权限吗?

android - 打开位置 (GPS) 的 Action /Intent 是什么

java - Android SQLite - 尝试访问单行时出现 NullPointerException 但可以访问整个数据吗?

android - 选择复选框后,所有 ListView 项目复选框均未选中