android - SecurityException: android.permission.INTERACT_ACROSS_USERS 缺少蓝牙访问
问题描述
尝试执行以下操作时在非系统应用程序上遇到此问题:“BluetoothAdapter::getProfileProxy”。仅在 android 8.1 上观察到,但不可重现。
Caused by: java.lang.SecurityException: query intent receivers: Neither user 15010171 nor current process has android.permission.INTERACT_ACROSS_USERS.
at android.os.Parcel.readException(Parcel.java:2021)
at android.os.Parcel.readException(Parcel.java:1967)
at android.content.pm.IPackageManager$Stub$Proxy.queryIntentServices(IPackageManager.java:4830)
at android.app.ApplicationPackageManager.queryIntentServicesAsUser(ApplicationPackageManager.java:1255)
at android.content.Intent.resolveSystemServiceAsUser(Intent.java:8365)
at android.bluetooth.BluetoothA2dp.doBind(BluetoothA2dp.java:432)
at android.bluetooth.BluetoothA2dp.<init>(BluetoothA2dp.java:405)
at android.bluetooth.BluetoothAdapter.getProfileProxy(BluetoothAdapter.java:3034)
问题:
为什么这个权限“INTERACT_ACROSS_USERS”会成为一个问题。(我们检查蓝牙许可)
-
boolean doBind() { Intent intent = new Intent(IBluetoothA2dp.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); ...
看起来权限问题在其他地方 - 在某些系统服务中。
想知道是否有人可以解释这个问题。
解决方案
推荐阅读
- java - Springboot 不为 OffsetDateTime 字段赋值
- c# - 使用等于运算符对无穷大进行有效检查吗?
- ruby-on-rails - Puma 服务器因 ThreadError 停止(死锁;递归锁定)
- php - 我会在一页中使用 $ _POST 两次
- python - “apyori模块的RelationRecord对象”先验算法python
- php - 将 SEO 友好的 URL 重定向回具有正常链接的页面
- ios - 如何模仿 Apple Map 的翻译表视图?
- java - 调用嵌套静态 Asynctask 的 Lint 泄漏警告
- php - 添加场景输出/从步骤返回数据并显示
- regex - BASH 查找名称中带有 ñ 的文件